Bug 514033 - Error recovery for imagelib - part 3 - Make errors returned by superclass methods contingent only on IsError().r=joe,a=blocker

This commit is contained in:
Bobby Holley 2010-09-12 08:22:28 -07:00
parent 9401c8f0d2
commit 83acf8a223

View File

@ -75,23 +75,25 @@ Decoder::Init(RasterImage* aImage, imgIDecoderObserver* aObserver)
mObserver = aObserver;
// Implementation-specific initialization
nsresult rv = InitInternal();
InitInternal();
mInitialized = true;
return rv;
return IsError() ? NS_ERROR_FAILURE : NS_OK;
}
nsresult
Decoder::Write(const char* aBuffer, PRUint32 aCount)
{
// Pass the data along to the implementation
return WriteInternal(aBuffer, aCount);
WriteInternal(aBuffer, aCount);
return IsError() ? NS_ERROR_FAILURE : NS_OK;
}
nsresult
Decoder::Finish()
{
// Implementation-specific finalization
return FinishInternal();
FinishInternal();
return IsError() ? NS_ERROR_FAILURE : NS_OK;
}
void