summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd_color.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/libgd/gd_color.c')
-rw-r--r--ext/gd/libgd/gd_color.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/gd/libgd/gd_color.c b/ext/gd/libgd/gd_color.c
index a4e56b1c40..e6f539bc75 100644
--- a/ext/gd/libgd/gd_color.c
+++ b/ext/gd/libgd/gd_color.c
@@ -33,8 +33,8 @@ int gdImageColorMatch (gdImagePtr im1, gdImagePtr im2)
return -4; /* At least 1 color must be allocated */
}
- buf = (unsigned long *)safe_emalloc(sizeof(unsigned long), 5 * im2->colorsTotal, 0);
- memset( buf, 0, sizeof(unsigned long) * 5 * im2->colorsTotal );
+ buf = (unsigned long *)safe_emalloc(sizeof(unsigned long), 5 * gdMaxColors, 0);
+ memset( buf, 0, sizeof(unsigned long) * 5 * gdMaxColors );
for (x=0; x<im1->sx; x++) {
for( y=0; y<im1->sy; y++ ) {