diff options
Diffstat (limited to 'Build/source/libs/gd/libgd-src/src/gd_color_match.c')
-rw-r--r-- | Build/source/libs/gd/libgd-src/src/gd_color_match.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Build/source/libs/gd/libgd-src/src/gd_color_match.c b/Build/source/libs/gd/libgd-src/src/gd_color_match.c index f0842b69ed7..f0194302ee1 100644 --- a/Build/source/libs/gd/libgd-src/src/gd_color_match.c +++ b/Build/source/libs/gd/libgd-src/src/gd_color_match.c @@ -31,9 +31,8 @@ BGD_DECLARE(int) gdImageColorMatch (gdImagePtr im1, gdImagePtr im2) return -4; /* At least 1 color must be allocated */ } - buf = (unsigned long *)gdMalloc(sizeof(unsigned long) * 5 * im2->colorsTotal); - memset (buf, 0, sizeof(unsigned long) * 5 * im2->colorsTotal ); - + buf = (unsigned long *)gdMalloc(sizeof(unsigned long) * 5 * gdMaxColors); + memset (buf, 0, sizeof(unsigned long) * 5 * gdMaxColors ); for (x=0; x < im1->sx; x++) { for( y=0; y<im1->sy; y++ ) { color = im2->pixels[y][x]; |