summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2010-05-24 23:52:11 (GMT)
committerRasmus Lerdorf <rasmus@php.net>2010-05-24 23:52:11 (GMT)
commita906125fec6aab542bf40a74a5995e688550fad5 (patch)
tree7b19577a10d102d7ff4e36885cb8e7fad8104263
parent13a09194a9a1340f79eea63c5ffe9b3f12b767d2 (diff)
downloadphp-a906125fec6aab542bf40a74a5995e688550fad5.tar.gz
Check for -1 as well here
-rw-r--r--ext/gd/libgd/gd_png.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c
index 1af4930..49f7cb0 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);