Bug 1098108 (Part 1) - Don't overwrite nsICODecoder's progress with the contained decoder's progress. r=tn
authorSeth Fowler <seth@mozilla.com>
Fri, 14 Nov 2014 20:10:48 -0800
changeset 215892 2750a8bef37d582c6da75a06c22d8f28e455b8d1
parent 215891 a2dd570e935086747234171c3332dd149ea88504
child 215893 4a54f722b1cde8867dc8dc16c8f54ba0e7e8c647
push id27829
push usergszorc@mozilla.com
push dateSat, 15 Nov 2014 22:34:49 +0000
treeherderautoland@19f75e1211e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs1098108
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1098108 (Part 1) - Don't overwrite nsICODecoder's progress with the contained decoder's progress. r=tn
image/decoders/nsICODecoder.cpp
--- a/image/decoders/nsICODecoder.cpp
+++ b/image/decoders/nsICODecoder.cpp
@@ -78,17 +78,17 @@ nsICODecoder::FinishInternal()
 {
   // We shouldn't be called in error cases
   NS_ABORT_IF_FALSE(!HasError(), "Shouldn't call FinishInternal after error!");
 
   // Finish the internally used decoder as well
   if (mContainedDecoder) {
     mContainedDecoder->FinishSharedDecoder();
     mDecodeDone = mContainedDecoder->GetDecodeDone();
-    mProgress = mContainedDecoder->GetProgress();
+    mProgress |= mContainedDecoder->GetProgress();
   }
 }
 
 // Returns a buffer filled with the bitmap file header in little endian:
 // Signature 2 bytes 'BM'
 // FileSize      4 bytes File size in bytes
 // reserved      4 bytes unused (=0)
 // DataOffset    4 bytes File offset to Raster Data
@@ -582,17 +582,17 @@ nsICODecoder::WriteInternal(const char* 
   }
 }
 
 bool
 nsICODecoder::WriteToContainedDecoder(const char* aBuffer, uint32_t aCount,
                                       DecodeStrategy aStrategy)
 {
   mContainedDecoder->Write(aBuffer, aCount, aStrategy);
-  mProgress = mContainedDecoder->GetProgress();
+  mProgress |= mContainedDecoder->GetProgress();
   if (mContainedDecoder->HasDataError()) {
     mDataError = mContainedDecoder->HasDataError();
   }
   if (mContainedDecoder->HasDecoderError()) {
     PostDecoderError(mContainedDecoder->GetDecoderError());
   }
   return !HasError();
 }
@@ -627,17 +627,17 @@ nsICODecoder::NeedsNewFrame() const
 }
 
 nsresult
 nsICODecoder::AllocateFrame()
 {
   if (mContainedDecoder) {
     nsresult rv = mContainedDecoder->AllocateFrame();
     mCurrentFrame = mContainedDecoder->GetCurrentFrame();
-    mProgress = mContainedDecoder->GetProgress();
+    mProgress |= mContainedDecoder->GetProgress();
     return rv;
   }
 
   return Decoder::AllocateFrame();
 }
 
 } // namespace image
 } // namespace mozilla