2007-01-16 00:13:51 +01:00
|
|
|
--- gd.c
|
|
|
|
+++ gd.c
|
2007-02-25 23:24:04 +01:00
|
|
|
@@ -147,6 +151,7 @@
|
|
|
|
}
|
2007-01-16 00:13:51 +01:00
|
|
|
memset (im, 0, sizeof (gdImage));
|
2007-02-25 23:24:04 +01:00
|
|
|
if (overflow2(sizeof (int *), sy)) {
|
2007-01-16 00:13:51 +01:00
|
|
|
+ gdFree(im);
|
2007-02-25 23:24:04 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2007-01-16 00:13:51 +01:00
|
|
|
im->tpixels = (int **) gdMalloc (sizeof (int *) * sy);
|
2007-02-25 23:24:04 +01:00
|
|
|
@@ -2757,6 +2762,8 @@
|
2007-01-16 00:13:51 +01:00
|
|
|
}
|
|
|
|
bytes = (w * h / 8) + 1;
|
|
|
|
im = gdImageCreate (w, h);
|
|
|
|
+ if (!im)
|
|
|
|
+ return NULL;
|
|
|
|
gdImageColorAllocate (im, 255, 255, 255);
|
|
|
|
gdImageColorAllocate (im, 0, 0, 0);
|
|
|
|
x = 0;
|
|
|
|
--- gd_gd.c
|
|
|
|
+++ gd_gd.c
|
|
|
|
@@ -149,6 +149,8 @@
|
|
|
|
{
|
|
|
|
im = gdImageCreate (*sx, *sy);
|
|
|
|
}
|
|
|
|
+ if (!im)
|
|
|
|
+ goto fail1;
|
|
|
|
if (!_gdGetColors (in, im, gd2xFlag))
|
|
|
|
{
|
|
|
|
goto fail2;
|