Bug 856602 - RasterImage::DecodeJob should not reschedule itself if it can't make progress. r=tn
authorSeth Fowler <seth@mozilla.com>
Thu, 04 Apr 2013 17:57:40 -0700
changeset 133413 3193c9695b2e5fdba96a8351f8ddc53208795d59
parent 133412 6fcbbe48902c9ceadec8da55aa1bd28e27ea072a
child 133414 88773e6debe38f356c6c037581da9c015e993b99
push id3634
push usermfowler@mozilla.com
push dateTue, 16 Apr 2013 00:33:49 +0000
treeherdermozilla-aurora@88773e6debe3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs856602
milestone22.0a2
Bug 856602 - RasterImage::DecodeJob should not reschedule itself if it can't make progress. r=tn
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -3772,17 +3772,18 @@ RasterImage::DecodePool::DecodeJob::Run(
   if (mImage->mDecoder && mImage->mDecoder->NeedsNewFrame()) {
     FrameNeededWorker::GetNewFrame(mImage);
   }
   // If we aren't yet finished decoding and we have more data in hand, add
   // this request to the back of the list.
   else if (mImage->mDecoder &&
            !mImage->mError &&
            !mImage->IsDecodeFinished() &&
-           bytesDecoded < mRequest->mBytesToDecode) {
+           bytesDecoded < mRequest->mBytesToDecode &&
+           bytesDecoded > 0) {
     DecodePool::Singleton()->RequestDecode(mImage);
   } else {
     // Nothing more for us to do - let everyone know what happened.
     DecodeDoneWorker::NotifyFinishedSomeDecoding(mImage, mRequest);
   }
 
   return NS_OK;
 }