Bug 1020439 - Call cairo_surface_destroy in GetCairoSurfaceForSourceSurface in case of failure. r=bas
authorSasha Fydrich <sasha.fydrich@student.42.fr>
Sun, 22 Jun 2014 11:10:07 -0700
changeset 189935 2b483618e693efaab3fa7e3f67ddb64ec41ad505
parent 189934 e0d435b1340e83a46eaa93ba1eb1758860e57ccc
child 189936 e3ab11ba56a5f9ddbbf83cfbdbdedcbe53660eae
push id45206
push useramccreight@mozilla.com
push dateSun, 22 Jun 2014 18:10:23 +0000
treeherdermozilla-inbound@35c527229cdb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs1020439
milestone33.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 1020439 - Call cairo_surface_destroy in GetCairoSurfaceForSourceSurface in case of failure. r=bas
gfx/2d/DrawTargetCairo.cpp
--- a/gfx/2d/DrawTargetCairo.cpp
+++ b/gfx/2d/DrawTargetCairo.cpp
@@ -172,16 +172,17 @@ GetCairoSurfaceForSourceSurface(SourceSu
                                         data->GetSize().height,
                                         data->Stride());
 
   // In certain scenarios, requesting larger than 8k image fails.  Bug 803568
   // covers the details of how to run into it, but the full detailed
   // investigation hasn't been done to determine the underlying cause.  We
   // will just handle the failure to allocate the surface to avoid a crash.
   if (cairo_surface_status(surf)) {
+    cairo_surface_destroy(surf);
     return nullptr;
   }
 
   cairo_surface_set_user_data(surf,
  				                      &surfaceDataKey,
  				                      data.forget().drop(),
  				                      ReleaseData);
   return surf;