From 4d5dd53b5ea5dcf531751fce301b367c8f622c24 Mon Sep 17 00:00:00 2001 From: Seth Fowler Date: Wed, 3 Apr 2013 19:18:42 -0700 Subject: [PATCH] Bug 856486 (Part 1) - Avoid asserts triggered by rapid off-main-thread decoding. r=jrmuizel --- image/src/RasterImage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index a5942f75730d..c1cc9f3109c2 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -2817,7 +2817,7 @@ RasterImage::RequestDecodeCore(RequestDecodeType aDecodeType) // data, so signal that we want a full decode and give up for now. if (!mHasSize) { mWantFullDecode = true; - return NS_ERROR_NOT_AVAILABLE; + return NS_OK; } } @@ -3525,7 +3525,8 @@ RasterImage::FinishedSomeDecoding(eShutdownIntent aIntent /* = eShutdownIntent_D } // If we were a size decode and a full decode was requested, now's the time. - if (NS_SUCCEEDED(rv) && done && wasSize && image->mWantFullDecode) { + if (NS_SUCCEEDED(rv) && aIntent != eShutdownIntent_Error && done && + wasSize && image->mWantFullDecode) { image->mWantFullDecode = false; // If we're not meant to be storing source data and we just got the size,