[cairo-commit] 3 commits - src/cairo-pattern.c src/cairo-traps.c test/.valgrind-suppressions

Chris Wilson ickle at kemper.freedesktop.org
Thu Jan 10 14:47:28 PST 2008


 src/cairo-pattern.c         |   10 +++++++++-
 src/cairo-traps.c           |    2 +-
 test/.valgrind-suppressions |   20 +++++++++++++++++---
 3 files changed, 27 insertions(+), 5 deletions(-)

New commits:
commit 6418a8be8719c9a969d9ec1f8624c841db9d2b90
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 21:35:05 2008 +0000

    [test/.valgrind-suppressions] Update for amd64/sid
    
    Update the valgrind suppressions for the libz and Xrm spam.

diff --git a/test/.valgrind-suppressions b/test/.valgrind-suppressions
index d791526..c28d586 100644
--- a/test/.valgrind-suppressions
+++ b/test/.valgrind-suppressions
@@ -18,6 +18,16 @@
    fun:deflate
  }
 {
+   bugs in libpng/libz
+   Memcheck:Cond
+   obj:/usr/lib/libz.so.1.2.3.3
+ }
+{
+   bugs in libpng/libz
+   Memcheck:Value8
+   obj:/usr/lib/libz.so.1.2.3.3
+ }
+{
    cairo's write_png triggers apparent bugs in libpng/libz
    Memcheck:Cond
    obj:/usr/lib/libz.so.1.2.2.2
@@ -209,7 +219,13 @@
    Memcheck:Leak
    fun:malloc
    fun:_XrmInternalStringToQuark
-   fun:XrmPermStringToQuark
+}
+{
+   XrmInitialize is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   obj:/usr/lib/libX11.so.6.2.0
+   fun:_XrmInternalStringToQuark
    fun:XrmInitialize
 }
 {
@@ -218,8 +234,6 @@
    fun:malloc
    fun:permalloc
    fun:_XrmInternalStringToQuark
-   fun:XrmPermStringToQuark
-   fun:XrmInitialize
 }
 {
    XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
commit 2e5f278da11369073eefeeedff7211bacb31ace1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 22:11:42 2008 +0000

    [cairo-pattern] Free the copied pattern on error.
    
    Free the locally allocated pattern if the copy fails.

diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 0c3ef4b..050c0d4 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -215,6 +215,8 @@ cairo_status_t
 _cairo_pattern_create_copy (cairo_pattern_t	  **pattern,
 			    const cairo_pattern_t  *other)
 {
+    cairo_status_t status;
+
     if (other->status)
 	return other->status;
 
@@ -235,7 +237,13 @@ _cairo_pattern_create_copy (cairo_pattern_t	  **pattern,
     if (*pattern == NULL)
 	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
-    return _cairo_pattern_init_copy (*pattern, other);
+    status = _cairo_pattern_init_copy (*pattern, other);
+    if (status) {
+	free (*pattern);
+	return status;
+    }
+
+    return CAIRO_STATUS_SUCCESS;
 }
 
 
commit db246f2fa22920a996a32f11233228e9af1d1abb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 21:32:47 2008 +0000

    [cairo-traps] Typo caught by valgrind.
    
    ==3429== Conditional jump or move depends on uninitialised value(s)
    ==3429==    at 0x4E3FB0F: _cairo_box_round_to_rectangle (cairo-fixed-private.h:196)
    ==3429==    by 0x4E34B29: _cairo_clip_intersect_to_rectangle (cairo-clip.c:162)
    ==3429==    by 0x4E31943: cairo_push_group_with_content (cairo.c:495)
    ==3429==    by 0x403044: draw (clip-zero.c:48)
    ==3429==    by 0x404221: cairo_test_expecting (cairo-test.c:377)
    ==3429==    by 0x64701C3: (below main) (libc-start.c:222)
    
    Caused by setting extents->p2.y to zero twice.

diff --git a/src/cairo-traps.c b/src/cairo-traps.c
index 41e18e9..c3d4329 100644
--- a/src/cairo-traps.c
+++ b/src/cairo-traps.c
@@ -570,7 +570,7 @@ _cairo_traps_extents (cairo_traps_t *traps, cairo_box_t *extents)
 {
     if (traps->num_traps == 0) {
 	extents->p1.x = extents->p1.y = _cairo_fixed_from_int (0);
-	extents->p2.y = extents->p2.y = _cairo_fixed_from_int (0);
+	extents->p2.x = extents->p2.y = _cairo_fixed_from_int (0);
     } else
 	*extents = traps->extents;
 }


More information about the cairo-commit mailing list