summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-17 11:56:17 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-04-17 12:00:40 +0100
commitf31ac2405bbd0755fb14daa6cb84d7bb7d84c492 (patch)
treedf9b5dddea7b7103f59578ac7a7e1f033264c83c /canvas
parentcd11e8df3d1b15d0488993b7cec9e3de7da06c8c (diff)
Resolves: rhbz#1086714 overlarge pixmap
Change-Id: I015308406a43e6b039059a5e35316d59745d0a48
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/cairo/cairo_canvasbitmap.cxx2
-rw-r--r--canvas/source/cairo/cairo_xlib_cairo.cxx7
2 files changed, 5 insertions, 4 deletions
diff --git a/canvas/source/cairo/cairo_canvasbitmap.cxx b/canvas/source/cairo/cairo_canvasbitmap.cxx
index 32c91672cd7c..eae13190088c 100644
--- a/canvas/source/cairo/cairo_canvasbitmap.cxx
+++ b/canvas/source/cairo/cairo_canvasbitmap.cxx
@@ -159,7 +159,7 @@ namespace cairocanvas
pPixels = cairo_image_surface_create( CAIRO_FORMAT_ARGB32,
aSize.Width(), aSize.Height() );
cairo_t *pCairo = cairo_create( pPixels );
- if( !pPixels || !pCairo )
+ if( !pPixels || !pCairo || cairo_status(pCairo) != CAIRO_STATUS_SUCCESS )
break;
// suck ourselves from the X server to this buffer so then we can fiddle with
diff --git a/canvas/source/cairo/cairo_xlib_cairo.cxx b/canvas/source/cairo/cairo_xlib_cairo.cxx
index f52a8e7be056..e5bb189e54f5 100644
--- a/canvas/source/cairo/cairo_xlib_cairo.cxx
+++ b/canvas/source/cairo/cairo_xlib_cairo.cxx
@@ -36,11 +36,12 @@ namespace
Pixmap limitXCreatePixmap(Display *display, Drawable d, unsigned int width, unsigned int height, unsigned int depth)
{
// The X protocol request CreatePixmap puts an upper bound
- // of 16 bit to the size.
+ // of 16 bit to the size. And in practice some drivers
+ // fall over with values close to the max.
- // see, e.g. moz#424333, fdo#48961
+ // see, e.g. moz#424333, fdo#48961, rhbz#1086714
// we've a duplicate of this in vcl :-(
- if (width > SAL_MAX_INT16 || height > SAL_MAX_INT16)
+ if (width > SAL_MAX_INT16-10 || height > SAL_MAX_INT16-10)
{
SAL_WARN("canvas", "overlarge pixmap: " << width << " x " << height);
return None;