Bug 695498. Cleanup WriteToDecoder a little. r=bholley

Removes the unobvious CONTAINER_ENSURE() which makes the fact that we only
adjust mBytesDecoded when we don't have success more obvious. This also takes
out a check for mDecoder that is unneeded because of the kungFuDeathGrip.
This commit is contained in:
Jeff Muizelaar 2011-10-19 14:48:18 -04:00
parent d8cdf2fb12
commit fcb2132a9d

View File

@ -2291,16 +2291,13 @@ RasterImage::WriteToDecoder(const char *aBuffer, PRUint32 aCount)
curframe->UnlockImageData();
}
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;
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;
}
// This function is called in situations where it's clear that we want the