Bug 1292628 - Make sure our surface is good before locking it. r=mstange, a=ritu
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Sun, 21 Aug 2016 12:27:07 +0200
changeset 347846 2da9027d1d97e238331057c80243184f5dafe22f
parent 347845 57ab6cc9d420e4a04b61a364754891f2298f0ae0
child 347847 41d9edca678070b9a830202c7fe9d60ca5c46c69
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, ritu
bugs1292628
milestone50.0a2
Bug 1292628 - Make sure our surface is good before locking it. r=mstange, a=ritu This should fix a crash in ssse3_fetch_bilinear_cover.
gfx/2d/DrawTargetCairo.cpp
--- a/gfx/2d/DrawTargetCairo.cpp
+++ b/gfx/2d/DrawTargetCairo.cpp
@@ -726,17 +726,18 @@ DrawTargetCairo::LockBits(uint8_t** aDat
 #ifdef CAIRO_HAS_WIN32_SURFACE
   if (cairo_surface_get_type(surf) == CAIRO_SURFACE_TYPE_WIN32) {
     cairo_surface_t* imgsurf = cairo_win32_surface_get_image(surf);
     if (imgsurf) {
       surf = imgsurf;
     }
   }
 #endif
-  if (cairo_surface_get_type(surf) == CAIRO_SURFACE_TYPE_IMAGE) {
+  if (cairo_surface_get_type(surf) == CAIRO_SURFACE_TYPE_IMAGE &&
+      cairo_surface_status(surf) == CAIRO_STATUS_SUCCESS) {
     PointDouble offset;
     cairo_surface_get_device_offset(target, &offset.x, &offset.y);
     // verify the device offset can be converted to integers suitable for a bounds rect
     IntPoint origin(int32_t(-offset.x), int32_t(-offset.y));
     if (-PointDouble(origin) != offset ||
         (!aOrigin && origin != IntPoint())) {
       return false;
     }