Bug 695498. Backout 7aa60d6408b3.

mDecoder can go NULL when we don't expect it.
This commit is contained in:
Jeff Muizelaar 2011-11-04 13:47:28 -04:00
parent 904af2501b
commit 275c15fce2

View File

@ -2281,13 +2281,16 @@ RasterImage::WriteToDecoder(const char *aBuffer, PRUint32 aCount)
curframe->UnlockImageData();
}
nsresult status = mDecoder->GetDecoderError();
if (NS_SUCCEEDED(status)) {
// Keep track of the total number of bytes written over the lifetime of the
// decoder
mBytesDecoded += aCount;
}
return status;
if (!mDecoder)
return NS_ERROR_FAILURE;
CONTAINER_ENSURE_SUCCESS(mDecoder->GetDecoderError());
// Keep track of the total number of bytes written over the lifetime of the
// decoder
mBytesDecoded += aCount;
return NS_OK;
}
// This function is called in situations where it's clear that we want the