Bug 1165009 - Bail in RasterImage::OnAddedFrame if we hit an error during decoding. r=tn, a=lizzard
authorSeth Fowler <mark.seth.fowler@gmail.com>
Thu, 14 May 2015 15:21:42 -0700
changeset 262187 8c02c3f9171f851643b820e9e1ac2e59d5d2afac
parent 262186 4fa5d922215a13da550883d8040f2f2f9f6f7bec
child 262188 f8c8d7ef332150473dbe351111a7050308400687
push id8023
push userryanvm@gmail.com
push dateMon, 18 May 2015 21:01:06 +0000
treeherdermozilla-aurora@ee7ff30474fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn, lizzard
bugs1165009
milestone40.0a2
Bug 1165009 - Bail in RasterImage::OnAddedFrame if we hit an error during decoding. r=tn, a=lizzard
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -930,16 +930,20 @@ RasterImage::OnAddedFrame(uint32_t aNewF
     NS_DispatchToMainThread(runnable);
     return;
   }
 
   MOZ_ASSERT((mFrameCount == 1 && aNewFrameCount == 1) ||
              mFrameCount < aNewFrameCount,
              "Frame count running backwards");
 
+  if (mError) {
+    return;  // We're in an error state, possibly due to OOM. Bail.
+  }
+
   if (aNewFrameCount > mFrameCount) {
     mFrameCount = aNewFrameCount;
 
     if (aNewFrameCount == 2) {
       // We're becoming animated, so initialize animation stuff.
       MOZ_ASSERT(!mAnim, "Already have animation state?");
       mAnim = MakeUnique<FrameAnimator>(this, mSize, mAnimationMode);