From 83acf8a223d62ffdad2c9d5a78ce08f06b480d6c Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Sun, 12 Sep 2010 08:22:28 -0700 Subject: [PATCH] Bug 514033 - Error recovery for imagelib - part 3 - Make errors returned by superclass methods contingent only on IsError().r=joe,a=blocker --- modules/libpr0n/src/Decoder.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/libpr0n/src/Decoder.cpp b/modules/libpr0n/src/Decoder.cpp index 865b34bec71..7d9ebb9ed27 100644 --- a/modules/libpr0n/src/Decoder.cpp +++ b/modules/libpr0n/src/Decoder.cpp @@ -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