|
Lines 74-79
BGD_DECLARE(gdImagePtr) gdImageCreate (i
|
Link Here
|
|---|
|
im = (gdImage *) gdMalloc (sizeof (gdImage)); | im = (gdImage *) gdMalloc (sizeof (gdImage)); |
memset (im, 0, sizeof (gdImage)); | memset (im, 0, sizeof (gdImage)); |
/* Row-major ever since gd 1.3 */ | /* Row-major ever since gd 1.3 */ |
|
if (overflow2(sizeof (unsigned char *), sy)) { |
|
gdFree(im); |
|
return NULL; |
|
} |
im->pixels = (unsigned char **) gdMalloc (sizeof (unsigned char *) * sy); | im->pixels = (unsigned char **) gdMalloc (sizeof (unsigned char *) * sy); |
im->polyInts = 0; | im->polyInts = 0; |
im->polyAllocated = 0; | im->polyAllocated = 0; |
|
Lines 114-119
BGD_DECLARE(gdImagePtr) gdImageCreateTru
|
Link Here
|
|---|
|
gdImagePtr im; | gdImagePtr im; |
im = (gdImage *) gdMalloc (sizeof (gdImage)); | im = (gdImage *) gdMalloc (sizeof (gdImage)); |
memset (im, 0, sizeof (gdImage)); | memset (im, 0, sizeof (gdImage)); |
|
if (overflow2(sizeof (int *), sy)) { |
|
gdFree(im); |
|
return NULL; |
|
} |
im->tpixels = (int **) gdMalloc (sizeof (int *) * sy); | im->tpixels = (int **) gdMalloc (sizeof (int *) * sy); |
im->polyInts = 0; | im->polyInts = 0; |
im->polyAllocated = 0; | im->polyAllocated = 0; |
|
Lines 2462-2467
BGD_DECLARE(gdImagePtr) gdImageCreateFro
|
Link Here
|
|---|
|
} | } |
bytes = (w * h / 8) + 1; | bytes = (w * h / 8) + 1; |
im = gdImageCreate (w, h); | im = gdImageCreate (w, h); |
|
if (!im) |
|
return NULL; |
gdImageColorAllocate (im, 255, 255, 255); | gdImageColorAllocate (im, 255, 255, 255); |
gdImageColorAllocate (im, 0, 0, 0); | gdImageColorAllocate (im, 0, 0, 0); |
x = 0; | x = 0; |
|
Lines 149-154
_gdCreateFromFile (gdIOCtx * in, int *sx
|
Link Here
|
|---|
|
{ | { |
im = gdImageCreate (*sx, *sy); | im = gdImageCreate (*sx, *sy); |
} | } |
|
if (!im) |
|
goto fail1; |
if (!_gdGetColors (in, im, gd2xFlag)) | if (!_gdGetColors (in, im, gd2xFlag)) |
{ | { |
goto fail2; | goto fail2; |