[cairo-commit] src/cairo-xlib-surface.c

Vladimir Vukicevic vladimir at kemper.freedesktop.org
Thu Aug 28 16:58:57 PDT 2008


 src/cairo-xlib-surface.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit d756a4d6323d23cecb928822cdac7528859e7cf3
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date:   Thu Aug 28 23:58:29 2008 -0700

    [xlib] check for too-large surface size in create similar to avoid UNSUPPORTED loop

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 296ca48..e7116f3 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1151,6 +1151,9 @@ _cairo_xlib_surface_clone_similar (void			*abstract_surface,
 	if (! CAIRO_FORMAT_VALID (image_src->format))
 	    return CAIRO_INT_STATUS_UNSUPPORTED;
 
+	if (image_src->width > XLIB_COORD_MAX || image_src->height > XLIB_COORD_MAX)
+	    return CAIRO_STATUS_NO_MEMORY;
+
 	clone = (cairo_xlib_surface_t *)
 	    _cairo_xlib_surface_create_similar_with_format (surface, image_src->format,
 						image_src->width, image_src->height);


More information about the cairo-commit mailing list