im = gdImageCreateTrueColor(x_size, y_size);
+ if (!im) {
+ RETURN_FALSE;
+ }
+
ZEND_REGISTER_RESOURCE(return_value, im, le_gd);
}
/* }}} */
im = gdImageCreate(x_size, y_size);
+ if (!im) {
+ RETURN_FALSE;
+ }
+
ZEND_REGISTER_RESOURCE(return_value, im, le_gd);
}
/* }}} */
{
int i;
gdImagePtr im;
+
+ if (overflow2(sx, sy)) {
+ return NULL;
+ }
+
+ if (overflow2(sizeof(unsigned char *), sy)) {
+ return NULL;
+ }
+
im = (gdImage *) gdMalloc(sizeof(gdImage));
memset(im, 0, sizeof(gdImage));
/* Row-major ever since gd 1.3 */
{
int i;
gdImagePtr im;
+
+ if (overflow2(sx, sy)) {
+ return NULL;
+ }
+
+ if (overflow2(sizeof(unsigned char *), sy)) {
+ return NULL;
+ }
+
+ if (overflow2(sizeof(int), sx)) {
+ return NULL;
+ }
+
im = (gdImage *) gdMalloc(sizeof(gdImage));
memset(im, 0, sizeof(gdImage));
im->tpixels = (int **) gdMalloc(sizeof(int *) * sy);
int *stx, *sty;
/* We only need to use floating point to determine the correct stretch vector for one line's worth. */
double accum;
+
+ if (overflow2(sizeof(int), srcW)) {
+ return;
+ }
+ if (overflow2(sizeof(int), srcH)) {
+ return;
+ }
+
stx = (int *) gdMalloc (sizeof (int) * srcW);
sty = (int *) gdMalloc (sizeof (int) * srcH);
accum = 0;
return;
}
+ if (overflow2(sizeof(int), n)) {
+ return;
+ }
+
if (c == gdAntiAliased) {
fill_color = im->AA_color;
} else {
while (im->polyAllocated < n) {
im->polyAllocated *= 2;
}
+ if (overflow2(sizeof(int), im->polyAllocated)) {
+ return;
+ }
im->polyInts = (int *) gdRealloc(im->polyInts, sizeof(int) * im->polyAllocated);
}
miny = p[0].y;