From: Rasmus Lerdorf Date: Mon, 24 May 2010 23:52:11 +0000 (+0000) Subject: Check for -1 as well here X-Git-Tag: php-5.3.3RC1~139 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5583cd237f55b17dcf5e81009a489661e43a21b8;p=php Check for -1 as well here --- diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c index 1af49308c5..49f7cb0777 100644 --- a/ext/gd/libgd/gd_png.c +++ b/ext/gd/libgd/gd_png.c @@ -515,8 +515,8 @@ void gdImagePngCtxEx (gdImagePtr im, gdIOCtx * outfile, int level, int basefilte /* png_set_filter(png_ptr, 0, PNG_FILTER_NONE); */ /* 2.0.12: this is finally a parameter */ - if (level < 0 || level > 9) { - php_gd_error("gd-png error: compression level must be between 0 and 9"); + if (level != -1 && (level < 0 || level > 9)) { + php_gd_error("gd-png error: compression level must be 0 through 9"); return; } png_set_compression_level(png_ptr, level);