return NULL;
}
+ if (overflow2(sizeof(unsigned char *), sx)) {
+ return NULL;
+ }
+
im = (gdImage *) gdCalloc(1, sizeof(gdImage));
/* Row-major ever since gd 1.3 */
int thick = im->thick;
if (color == gdAntiAliased) {
- /*
+ /*
gdAntiAliased passed as color: use the much faster, much cheaper
and equally attractive gdImageAALine implementation. That
clips too, so don't clip twice.
*/
- gdImageAALine(im, x1, y1, x2, y2, im->AA_color);
+ gdImageAALine(im, x1, y1, x2, y2, im->AA_color);
return;
}
return;
}
- alphablending_bak = im->alphaBlendingFlag;
+ alphablending_bak = im->alphaBlendingFlag;
im->alphaBlendingFlag = 0;
if (nc==gdTiled){
wx2=im->sx;wy2=im->sy;
oc = gdImageGetPixel(im, x, y);
if (oc==nc || x<0 || x>wx2 || y<0 || y>wy2) {
- im->alphaBlendingFlag = alphablending_bak;
+ im->alphaBlendingFlag = alphablending_bak;
return;
}
efree(stack);
done:
- im->alphaBlendingFlag = alphablending_bak;
+ im->alphaBlendingFlag = alphablending_bak;
}
static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
x1ul = x1 - half;
y1ul = y1 - half;
-
+
x2lr = x2 + half;
y2lr = y2 + half;
int tox, toy;
int ncR, ncG, ncB;
toy = dstY;
-
+
for (y = srcY; y < (srcY + h); y++) {
tox = dstX;
for (x = srcX; x < (srcX + w); x++) {
int colorMap[gdMaxColors];
/* Stretch vectors */
int *stx, *sty;
-
+
if (overflow2(sizeof(int), srcW)) {
return;
}
src_weight = gdAlphaTransparent - src_alpha;
dst_weight = (gdAlphaTransparent - dst_alpha) * src_alpha / gdAlphaMax;
tot_weight = src_weight + dst_weight;
-
+
/* -------------------------------------------------------------------- */
/* What red, green and blue result values will we use? */
/* -------------------------------------------------------------------- */