xcb: Check that the extents are inside our surface

The previous commit fixed a bug in cairo-xlib found by a similar assert, so this
seems to be a good idea to have.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2011-07-27 19:52:58 +02:00
parent 73e8384ac8
commit 8877ca23f5

View file

@ -346,6 +346,11 @@ _get_image (cairo_xcb_surface_t *surface,
xcb_get_image_reply_t *reply;
cairo_int_status_t status;
assert (x >= 0);
assert (y >= 0);
assert (x + width <= surface->width);
assert (y + height <= surface->height);
if (surface->deferred_clear) {
image = (cairo_image_surface_t *)
_cairo_image_surface_create_with_pixman_format (NULL,