diff options
author | Carl Worth <cworth@cworth.org> | 2008-09-24 21:55:53 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2008-09-24 21:55:53 -0700 |
commit | 261dd83b31adb4a6b4d80f626b9d5fde5eb4d8f6 (patch) | |
tree | e5e32507e6bc75def45bfe9ee75db9ab43dcb7d2 /src/cairo-png.c | |
parent | 94d2820c6f64a2da13e6aeb4698198a3d4d0669b (diff) | |
download | cairo-261dd83b31adb4a6b4d80f626b9d5fde5eb4d8f6.tar.gz |
Eliminate paranoid check for PNG_INTERLACE_NONE.
Commit 20b1b33c0fc7 added some "paranoid checks" to our png
loading code. One of these was checking that if png_get_IHDR
first reports an interlace value other than PNG_INTERLACE_NONE
that after we call png_set_interlace_handling then we do
get PNG_INTERLACE_NONE from the next call to png_get_IHDR.
However, libpng doesn't seem to actually have that behavior.
When testing cairo_image_surface_create_from_png with an
interlanced PNG file, (which the test suite happens not to
do---even now), the call to png_set_interlace_handling is
doing the trick, but the check for PNG_INTERLACE_NONE is
failing.
So, with the check in place, loading an interlaced PNG image
fails with CAIRO_STATUS_READ_ERROR. By simply removing
that check, an interlaced image loads just fine.
Diffstat (limited to 'src/cairo-png.c')
-rw-r--r-- | src/cairo-png.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-png.c b/src/cairo-png.c index d807dac78..06e7cb557 100644 --- a/src/cairo-png.c +++ b/src/cairo-png.c @@ -524,7 +524,7 @@ read_png (png_rw_ptr read_func, png_get_IHDR (png, info, &png_width, &png_height, &depth, &color_type, &interlace, NULL, NULL); - if (depth != 8 || interlace != PNG_INTERLACE_NONE || + if (depth != 8 || ! (color_type == PNG_COLOR_TYPE_RGB || color_type == PNG_COLOR_TYPE_RGB_ALPHA)) { |