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 342445 e66d206c851c7d6410a2eb858e45e4d85c77796c
parent 342444 ffd7ae9b354a6fd5725bab8fdca0e6c6452f26aa
child 342446 c56047b7ac0dabf7e7ea4492e2da12fc92981691
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, ritu
bugs1292628
milestone49.0
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;
     }