Bug 715916 - Check the result of GetFrame in RasterImage::GetImageContainer. r=joe a=akeybl
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 17 Jan 2012 12:37:15 +1300
changeset 84076 2a3d24eab1030e5a58319e2f74de8a8566986de3
parent 84075 76c3d4e9cd54ca6ce1ca248d66fb74e477b14b1f
child 84077 096fa391d0ac69944191bc05060579ff15fdb6a1
push id720
push usermwoodrow@mozilla.com
push dateMon, 16 Jan 2012 23:41:03 +0000
treeherdermozilla-aurora@2a3d24eab103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe, akeybl
bugs715916
milestone11.0a2
Bug 715916 - Check the result of GetFrame in RasterImage::GetImageContainer. r=joe a=akeybl
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -944,17 +944,19 @@ RasterImage::GetImageContainer(LayerMana
        (!mImageContainer->Manager() && 
         (mImageContainer->GetBackendType() == aManager->GetBackendType())))) {
     *_retval = mImageContainer;
     return NS_OK;
   }
   
   CairoImage::Data cairoData;
   nsRefPtr<gfxASurface> imageSurface;
-  GetFrame(FRAME_CURRENT, FLAG_SYNC_DECODE, getter_AddRefs(imageSurface));
+  nsresult rv = GetFrame(FRAME_CURRENT, FLAG_SYNC_DECODE, getter_AddRefs(imageSurface));
+  NS_ENSURE_SUCCESS(rv, rv);
+
   cairoData.mSurface = imageSurface;
   GetWidth(&cairoData.mSize.width);
   GetHeight(&cairoData.mSize.height);
 
   mImageContainer = aManager->CreateImageContainer();
   NS_ASSERTION(mImageContainer, "Failed to create ImageContainer!");
   
   // Now create a CairoImage to display the surface.