[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/esr24] 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



commit 69f9b401dfffdc377205f0fa77d0894a812ad9d6
Author: Timothy Nikkel <tnikkel@xxxxxxxxx>
Date:   Wed Feb 26 21:48:47 2014 -0600

    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 |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp
index 8b066434..42d4232 100644
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -3398,6 +3398,11 @@ RasterImage::DecodePool::DecodeSomeOfImage(RasterImage* aImg,
   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)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits