Bug 511689 - Ensure we're always on the correct frame when decoding GIF images. r=jrmuizel,alfredkeyser sr=vlad

This commit is contained in:
Joe Drew 2009-09-02 11:50:14 -04:00
parent f605743309
commit 1fd72ad1bb

View File

@ -421,10 +421,14 @@ void nsGIFDecoder2::EndImageFrame()
// image frame decoded before we go off and try to display another frame.
mImageContainer->SetFrameTimeout(mGIFStruct.images_decoded, mGIFStruct.delay_time);
mImageContainer->EndFrameDecode(mGIFStruct.images_decoded);
mGIFStruct.images_decoded++;
}
// Unconditionally increment images_decoded, because we unconditionally
// append frames in BeginImageFrame(). This ensures that images_decoded
// always refers to the frame in mImageContainer we're currently decoding,
// even if some of them weren't decoded properly and thus are blank.
mGIFStruct.images_decoded++;
if (mObserver)
mObserver->OnStopFrame(nsnull, curframe);