Bug 715916 - Check the result of GetFrame in RasterImage::GetImageContainer. r=joe
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 11 Jan 2012 13:33:20 +1300
changeset 84195 c16d6dc44101276c0a9256b648ba5cf385cab152
parent 84194 f2df780ad0476887699181cdfcd7b76ab0c05bf2
child 84196 b6a501cb1a64d2e95dee5745a182c2f158cde5d5
push id21832
push userbmo@edmorley.co.uk
push dateWed, 11 Jan 2012 17:04:15 +0000
treeherdermozilla-central@40c9f9ff9fd5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs715916
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 715916 - Check the result of GetFrame in RasterImage::GetImageContainer. r=joe
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -949,17 +949,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.