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

This commit is contained in:
Kyle Huey 2012-08-13 09:34:32 -07:00
Родитель 2d1471fe5d
Коммит 90a955bcf2
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -841,10 +841,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
@ -855,11 +857,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();