rasmus                                   Mon, 24 May 2010 23:52:11 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=299726

Log:
Check for -1 as well here

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/gd/libgd/gd_png.c
    U   php/php-src/trunk/ext/gd/libgd/gd_png.c

Modified: php/php-src/branches/PHP_5_3/ext/gd/libgd/gd_png.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/gd/libgd/gd_png.c  2010-05-24 23:27:39 UTC 
(rev 299725)
+++ php/php-src/branches/PHP_5_3/ext/gd/libgd/gd_png.c  2010-05-24 23:52:11 UTC 
(rev 299726)
@@ -515,8 +515,8 @@
        /*  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);

Modified: php/php-src/trunk/ext/gd/libgd/gd_png.c
===================================================================
--- php/php-src/trunk/ext/gd/libgd/gd_png.c     2010-05-24 23:27:39 UTC (rev 
299725)
+++ php/php-src/trunk/ext/gd/libgd/gd_png.c     2010-05-24 23:52:11 UTC (rev 
299726)
@@ -515,8 +515,8 @@
        /*  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);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to