Bug 857876 - If we're not storing source data, explicitly shut down the decoder when the image data is complete. r=seth

This commit is contained in:
Joe Drew 2013-04-16 15:55:45 -04:00
parent 9205e033e1
commit 657125683f

View File

@ -1759,6 +1759,13 @@ RasterImage::DoImageDataComplete()
{
MutexAutoLock lock(mDecodingMutex);
// If we're not storing any source data, then there's nothing more we can do
// once we've tried decoding for size.
if (!StoringSourceData() && mDecoder) {
nsresult rv = ShutdownDecoder(eShutdownIntent_Done);
CONTAINER_ENSURE_SUCCESS(rv);
}
// If DecodeUntilSizeAvailable didn't finish the decode, let the decode worker
// finish decoding this image.
if (mDecoder) {
@ -2596,6 +2603,7 @@ nsresult
RasterImage::ShutdownDecoder(eShutdownIntent aIntent)
{
MOZ_ASSERT(NS_IsMainThread());
mDecodingMutex.AssertCurrentThreadOwns();
// Ensure that our intent is valid
NS_ABORT_IF_FALSE((aIntent >= 0) && (aIntent < eShutdownIntent_AllCount),