addresses in the filter extension). (Ilia)
- Fixed bug #47430 (Errors after writing to nodeValue parameter of an absent
previousSibling). (Rob)
+- Fixed bug #45799 (imagepng() crashes on empty image). (Martin McNickle,
+ Takeshi Abe)
26 Feb 2009, PHP 5.2.9
- Changed __call() to be invoked on private/protected method access, similar to
++colors;
}
}
+ if (colors == 0) {
+ php_gd_error("gd-png error: no colors in palette");
+ goto bail;
+ }
if (colors < im->colorsTotal) {
remap = TRUE;
}
}
}
/* 1.6.3: maybe we should give that memory BACK! TBB */
+ bail:
png_destroy_write_struct(&png_ptr, &info_ptr);
}
--- /dev/null
+--TEST--
+Bug #45799 (imagepng() crashes on empty image).
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+$img = imagecreate(500,500);
+imagepng($img);
+imagedestroy($img);
+?>
+--EXPECTF--
+
+Warning: imagepng(): gd-png error: no colors in palette in %s on line %d