Bug 944353. If we've encountered an error while decoding an image and the main thread has asked to do more decoding of that image before the main thread has acknowledged the error then refuse to decode more. r=seth a=sledru
authorTimothy Nikkel <tnikkel@gmail.com>
Wed, 26 Feb 2014 21:48:47 -0600
changeset 183725 1cf083a2ffe711e881a1ccb662fb775ad0940bcc
parent 183724 f1c211a4714dc22540c70f2e51d85999b1890096
child 183726 d27facd3d35dab5422889e64ae1784b01c86e46a
push id3459
push usertnikkel@gmail.com
push dateSun, 13 Apr 2014 03:56:53 +0000
treeherdermozilla-beta@d27facd3d35d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth, sledru
bugs944353
milestone29.0
Bug 944353. If we've encountered an error while decoding an image and the main thread has asked to do more decoding of that image before the main thread has acknowledged the error then refuse to decode more. r=seth a=sledru
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -3355,16 +3355,21 @@ RasterImage::DecodePool::DecodeSomeOfIma
                     "Worker active for uninitialized container!");
   aImg->mDecodingMonitor.AssertCurrentThreadIn();
 
   // If an error is flagged, it probably happened while we were waiting
   // in the event queue.
   if (aImg->mError)
     return NS_OK;
 
+  // If there is an error worker pending (say because the main thread has enqueued
+  // another decode request for us before processing the error worker) then bail out.
+  if (aImg->mPendingError)
+    return NS_OK;
+
   // If mDecoded or we don't have a decoder, we must have finished already (for
   // example, a synchronous decode request came while the worker was pending).
   if (!aImg->mDecoder || aImg->mDecoded)
     return NS_OK;
 
   // If we're doing synchronous decodes, and we're waiting on a new frame for
   // this image, get it now.
   if (aStrategy == DECODE_SYNC && aImg->mDecoder->NeedsNewFrame()) {