Bug 683290: Make RasterImage::GetFrame actually honor the flags it is passed. r=bholley

This commit is contained in:
Kyle Huey 2011-10-10 12:18:53 -04:00
parent de5c7e5bdc
commit a0231db826

View File

@ -683,10 +683,12 @@ RasterImage::GetFrame(PRUint32 aWhichFrame,
nsresult rv = NS_OK;
PRUint32 desiredDecodeFlags = aFlags & DECODE_FLAGS_MASK;
if (mDecoded) {
// If we have decoded data, and it is not a perfect match for what we are
// looking for, we must discard to be able to generate the proper data.
PRUint32 desiredDecodeFlags = aFlags & DECODE_FLAGS_MASK;
if (desiredDecodeFlags != mFrameDecodeFlags) {
// if we can't discard, then we're screwed; we have no way
// to re-decode. Similarly if we aren't allowed to do a sync
@ -697,11 +699,11 @@ RasterImage::GetFrame(PRUint32 aWhichFrame,
return NS_ERROR_NOT_AVAILABLE;
ForceDiscard();
mFrameDecodeFlags = desiredDecodeFlags;
}
}
mFrameDecodeFlags = desiredDecodeFlags;
// If the caller requested a synchronous decode, do it
if (aFlags & FLAG_SYNC_DECODE) {
rv = SyncDecode();