--- /repository/php-src/ext/gd/libgd/gd.c 2008/07/31 09:23:59 1.115 +++ /repository/php-src/ext/gd/libgd/gd.c 2008/12/10 13:30:11 1.116 @@ -3129,7 +3129,7 @@ return NULL; } - if (!gdImageTrueColor(src) && clrBack>=gdImageColorsTotal(src)) { + if (!gdImageTrueColor(src) && (clrBack < 0 || clrBack>=gdImageColorsTotal(src))) { return NULL; }