gd/gd-2.1.0-color_c_null_pointer.patch

19 lines
654 B
Diff

diff -up ./src/gdxpm.c.color_c_null_pointer ./src/gdxpm.c
--- ./src/gdxpm.c.color_c_null_pointer 2013-06-25 11:58:23.000000000 +0200
+++ ./src/gdxpm.c 2014-07-16 16:43:44.000000000 +0200
@@ -62,6 +62,13 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFro
for(i = 0; i < number; i++) {
char *c_color = image.colorTable[i].c_color;
+ if (!c_color)
+ {
+ /* unsupported color key or color key not defined */
+ gdImageDestroy(im);
+ im = 0;
+ goto done;
+ }
if(strcmp(c_color, "None") == 0) {
colors[i] = gdImageGetTransparent(im);
if(colors[i] == -1) colors[i] = gdImageColorAllocate(im, 0, 0, 0);
diff -up ./x.color_c_null_pointer ./x