Bug 944353. If we've had a decoder error then the image is not usable. r=seth
authorTimothy Nikkel <tnikkel@gmail.com>
Wed, 26 Feb 2014 21:48:51 -0600
changeset 171242 f71474f7081b7b4f63d875a56f93578e256e11d9
parent 171241 24dcfacab028d6425ff61ea6f81820d91d4182b4
child 171243 bb4d62536dfd1ff944a26b5b359ad02480c06e0a
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersseth
bugs944353
milestone30.0a1
Bug 944353. If we've had a decoder error then the image is not usable. r=seth This matches what RasterImage will do.
image/src/Decoder.cpp
--- a/image/src/Decoder.cpp
+++ b/image/src/Decoder.cpp
@@ -150,17 +150,17 @@ Decoder::Finish(RasterImage::eShutdownIn
                          NS_ConvertUTF8toUTF16(mImage.GetURIString()),
                          EmptyString(), 0, 0, nsIScriptError::errorFlag,
                          "Image", mImage.InnerWindowID()
                        ))) {
         consoleService->LogMessage(errorObject);
       }
     }
 
-    bool usable = true;
+    bool usable = !HasDecoderError();
     if (aShutdownIntent != RasterImage::eShutdownIntent_NotNeeded && !HasDecoderError()) {
       // If we only have a data error, we're usable if we have at least one complete frame.
       if (GetCompleteFrameCount() == 0) {
         usable = false;
       }
     }
 
     // If we're usable, do exactly what we should have when the decoder