Bug 958758. If we need to re-decode an image with different flags and shutting down the existing decoder has caused us to finish decoding we need to discard the image so we can create a new decoder with the new flags. r=seth

This commit is contained in:
Timothy Nikkel 2014-01-21 17:19:20 -06:00
parent 674998ae98
commit e1d75aac97

View File

@ -2374,6 +2374,15 @@ RasterImage::SyncDecode()
if (mDecoder && mDecoder->GetDecodeFlags() != mFrameDecodeFlags) {
nsresult rv = FinishedSomeDecoding(eShutdownIntent_NotNeeded);
CONTAINER_ENSURE_SUCCESS(rv);
if (mDecoded) {
// If we've finished decoding we need to discard so we can re-decode
// with the new flags. If we can't discard then there isn't
// anything we can do.
if (!CanForciblyDiscard() || mDecoder || mAnim)
return NS_ERROR_NOT_AVAILABLE;
ForceDiscard();
}
}
// If we're currently waiting on a new frame for this image, we have to create