[cairo-commit] 3 commits - boilerplate/cairo-boilerplate.c src/cairo-ft-font.c src/cairo-pdf-surface.c

Carl Worth cworth at kemper.freedesktop.org
Fri Apr 6 12:40:04 PDT 2007


 boilerplate/cairo-boilerplate.c |    3 ++-
 src/cairo-ft-font.c             |    2 ++
 src/cairo-pdf-surface.c         |    5 ++++-
 3 files changed, 8 insertions(+), 2 deletions(-)

New commits:
diff-tree 8bb0e5939c0694e88ea9ede4137d7306a067bd17 (from b95577a931645b3013d5acaa5b1bd2d892c3932f)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Mar 28 20:27:29 2007 +0100

    _get_bitmap_surface - check for calloc failure

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index c703b98..0da7d67 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -819,6 +819,8 @@ _get_bitmap_surface (FT_Bitmap		     *bi
 	    stride = bitmap->pitch;
 	    stride_rgba = (width_rgba * 4 + 3) & ~3;
 	    data_rgba = calloc (1, stride_rgba * height);
+	    if (data_rgba == NULL)
+		return CAIRO_STATUS_NO_MEMORY;
 
 	    os = 1;
 	    switch (font_options->subpixel_order) {
diff-tree b95577a931645b3013d5acaa5b1bd2d892c3932f (from 2a74fd5c7ff21f27013f709dc626be8087cb6a10)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Mar 28 17:58:31 2007 +0100

    Protect boilerplate_xlib_synchronize from alloc failure.
    
    Don't call XDestroyImage on a NULL image.

diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index be168e5..6a1acb8 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -843,7 +843,8 @@ boilerplate_xlib_synchronize (void *clos
 
     ximage = XGetImage (xtc->dpy, xtc->drawable,
 			0, 0, 1, 1, AllPlanes, ZPixmap);
-    XDestroyImage (ximage);
+    if (ximage != NULL)
+	XDestroyImage (ximage);
 }
 
 /* For the xlib backend we distinguish between TEST and PERF mode in a
diff-tree 2a74fd5c7ff21f27013f709dc626be8087cb6a10 (from a2a8f2ce7a0a9bcef7a4a29624725a77c2abe95a)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Mar 28 15:50:12 2007 +0100

    Propagate one error return through pdf.

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 3e8375f..a5b18c5 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -1190,6 +1190,7 @@ _cairo_pdf_surface_emit_linear_pattern (
     cairo_pdf_resource_t function, pattern_resource, alpha;
     double x0, y0, x1, y1;
     cairo_matrix_t p2u;
+    cairo_status_t status;
 
     _cairo_pdf_surface_pause_content_stream (surface);
 
@@ -1198,7 +1199,9 @@ _cairo_pdf_surface_emit_linear_pattern (
 	return CAIRO_STATUS_NO_MEMORY;
 
     p2u = pattern->base.base.matrix;
-    cairo_matrix_invert (&p2u);
+    status = cairo_matrix_invert (&p2u);
+    if (status)
+	return status;
 
     x0 = _cairo_fixed_to_double (pattern->gradient.p1.x);
     y0 = _cairo_fixed_to_double (pattern->gradient.p1.y);


More information about the cairo-commit mailing list