|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Oct 2005, PHP 5.1 Release Candidate 4
- Fixed fgetcsv() and fputcsv() inconsistency. (Dmitry)
+- Fixed bug #34996 (ImageTrueColorToPalette() crashes when ncolors is
+ zero). (Tony)
- Fixed bug #34977 (Compile failure on MacOSX due to use of varargs.h). (Tony)
- Fixed bug #34968 (bz2 extension fails on to build on some win32 setups).
(Ilia)
convert_to_boolean_ex(dither);
convert_to_long_ex(ncolors);
+ if (Z_LVAL_PP(ncolors) <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of colors has to be greater than zero");
+ RETURN_FALSE;
+ }
gdImageTrueColorToPalette(im, Z_LVAL_PP(dither), Z_LVAL_PP(ncolors));
RETURN_TRUE;