[cairo-commit] 2 commits - src/cairo-png.c test/Makefile.am

Chris Wilson ickle at kemper.freedesktop.org
Tue Apr 22 06:34:38 PDT 2008


 src/cairo-png.c  |    3 ++-
 test/Makefile.am |    7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit b4b77cedc9db73f1ba8af16704302a4b2cc3f184
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Apr 21 22:50:59 2008 +0100

    [test/Makefile.am] EXTRA_DIST += create-from-png*-ref.png
    
    Add the new reference images for create-from-png to the distributable.

diff --git a/test/Makefile.am b/test/Makefile.am
index 7228e60..11880cb 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -321,7 +321,12 @@ REFERENCE_IMAGES = \
 	composite-integer-translate-source-ref.png	\
 	copy-path-ps-ref.png	\
 	copy-path-ref.png	\
-	create-from-png-ref.png	\
+	create-from-png-ref.png			\
+	create-from-png-alpha-ref.png		\
+	create-from-png-gray-ref.png		\
+	create-from-png-gray-alpha-ref.png	\
+	create-from-png-indexed-ref.png		\
+	create-from-png-indexed-alpha-ref.png	\
 	create-from-png-stream-ref.png	\
 	dash-caps-joins-ps-argb32-ref.png	\
 	dash-caps-joins-ps-rgb24-ref.png	\
commit 63bba7e60c0c83f5456aa52611212264478148b4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Apr 21 20:15:28 2008 +0100

    [cairo-png] Call png_set_filler() before png_read_update_info().
    
    Otherwise libpng gets very confused and we start scribbling over invalid
    memory whilst reading in the PNG.

diff --git a/src/cairo-png.c b/src/cairo-png.c
index c1cda34..9476ab6 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -504,6 +504,8 @@ read_png (png_rw_ptr	read_func,
     if (interlace != PNG_INTERLACE_NONE)
         png_set_interlace_handling (png);
 
+    png_set_filler (png, 0xff, PNG_FILLER_AFTER);
+
     /* recheck header after setting EXPAND options */
     png_read_update_info (png, info);
     png_get_IHDR (png, info,
@@ -530,7 +532,6 @@ read_png (png_rw_ptr	read_func,
 	case PNG_COLOR_TYPE_RGB:
 	    format = CAIRO_FORMAT_RGB24;
 	    png_set_read_user_transform_fn (png, convert_bytes_to_data);
-	    png_set_filler (png, 0xff, PNG_FILLER_AFTER);
 	    break;
     }
 


More information about the cairo-commit mailing list