Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 7b39a47817d344f86f39eece248d8d83 > files > 9

libgd-2.2.5-2.3.mga6.src.rpm

Index: libgd2-2.2.5/src/gd_color_match.c
===================================================================
--- libgd2-2.2.5/src/gd_color_match.c
+++ libgd2-2.2.5/src/gd_color_match.c	2019-01-13 10:42:48.875452181 +0100
@@ -31,8 +31,8 @@
 		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++ ) {