summaryrefslogtreecommitdiff
path: root/src/cairo-png.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-04-21 20:15:28 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-04-21 20:15:28 +0100
commit63bba7e60c0c83f5456aa52611212264478148b4 (patch)
tree70189973b924398118a453049e8acf88929c4a67 /src/cairo-png.c
parent20b1b33c0fc76d2ec2b4f83d9ce058429c4f49db (diff)
[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.
Diffstat (limited to 'src/cairo-png.c')
-rw-r--r--src/cairo-png.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cairo-png.c b/src/cairo-png.c
index c1cda34a..9476ab60 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;
}