Bug 767779 - Stop eating animation frames for non-multipart. r=joe a=lsblakk
authorAdam Dane [:hobophobe] <unusualtears@gmail.com>
Sat, 21 Jul 2012 20:07:15 -0500
changeset 100444 fae49a9eda43e551744abe3b730ee6dc33f415f0
parent 100443 edaab0f48feb228143e0ca580d5fdccf07383737
child 100445 e6e93246223e0a2bb02d9e62101f48cd38dd45f1
push id1238
push userjdrew@mozilla.com
push dateTue, 07 Aug 2012 15:57:22 +0000
treeherdermozilla-beta@fae49a9eda43 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe, lsblakk
bugs767779
milestone15.0
Bug 767779 - Stop eating animation frames for non-multipart. r=joe a=lsblakk
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -1446,20 +1446,26 @@ RasterImage::AddSourceData(const char *a
 
   // We should not call this if we're already finished adding source data
   NS_ABORT_IF_FALSE(!mHasSourceData, "Calling AddSourceData() after calling "
                                      "sourceDataComplete()!");
 
   // This call should come straight from necko - no reentrancy allowed
   NS_ABORT_IF_FALSE(!mInDecoder, "Re-entrant call to AddSourceData!");
 
+  // Image is already decoded, we shouldn't be getting data, but it could
+  // be extra garbage data at the end of a file.
+  if (mDecoded) {
+    return NS_OK;
+  }
+
   // Starting a new part's frames, let's clean up before we add any
   // This needs to happen just before we start getting EnsureFrame() call(s),
   // so that there's no gap for anything to miss us.
-  if (mBytesDecoded == 0) {
+  if (mMultipart && mBytesDecoded == 0) {
     // Our previous state may have been animated, so let's clean up
     bool wasAnimating = mAnimating;
     if (mAnimating) {
       StopAnimation();
       mAnimating = false;
     }
     mAnimationFinished = false;
     if (mAnim) {