Bug 767779 - Stop eating animation frames for non-multipart. r=joe

This commit is contained in:
Adam Dane [:hobophobe] 2012-07-16 20:40:46 -05:00
parent 773f33f6c2
commit 326485e15c

View File

@ -1451,10 +1451,16 @@ RasterImage::AddSourceData(const char *aBuffer, PRUint32 aCount)
// This call should come straight from necko - no reentrancy allowed
NS_ABORT_IF_FALSE(!mInDecoder, "Re-entrant call to AddSourceData!");
// The decoder is not accepting data, we shouldn't be getting it, but it could
// be extra garbage data at the end of a file.
if (!mDecoder || mDecoder->GetDecodeDone()) {
return NS_OK;
}
// Starting a new part's frames, let's clean up before we add any
// This needs to happen just before we start getting EnsureFrame() call(s),
// so that there's no gap for anything to miss us.
if (mBytesDecoded == 0) {
if (mMultipart && mBytesDecoded == 0) {
// Our previous state may have been animated, so let's clean up
if (mAnimating) {
StopAnimation();