[cairo-commit] Branch '1.0' - src/cairo-gstate.c

Carl Worth cworth at kemper.freedesktop.org
Mon Mar 13 12:32:07 PST 2006


 src/cairo-gstate.c |    3 +++
 1 files changed, 3 insertions(+)

New commits:
diff-tree 440bb68ef207b9101f355b2d1ccbaa5d1b166c4a (from 5e399f87785ce87b2b236b199a96efc99236167f)
Author: Carl Worth <cworth at cworth.org>
Date:   Mon Mar 13 12:30:00 2006 -0800

    _clip_and_composite_trapezoids: Avoid NULL pointer dereference due to OOM.
    
    This closes bug #6197:
    
    	Null pointer dereference on OOM in _clip_and_composite_trapezoids()
    	https://bugs.freedesktop.org/show_bug.cgi?id=6197
    (cherry picked from 6f0d8eedc504e8af2224c502be25dc82b5df70f4 commit)

diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index 3983233..67c6875 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -1439,6 +1439,9 @@ _cairo_surface_clip_and_composite_trapez
 		return status;
 	    
 	    clear_region = _cairo_region_create_from_rectangle (&extents);
+	    if (clear_region == NULL)
+		return CAIRO_STATUS_NO_MEMORY;
+
 	    status = _cairo_clip_intersect_to_region (clip, clear_region);
 	    if (status)
 		return status;


More information about the cairo-commit mailing list