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
Родитель 7b91b495f6
Коммит 03209d6147
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -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