Skip to content

Commit 40bec0f

Browse files
committed
Merge branch 'pull-request/296'
2 parents 0423df1 + 2806adf commit 40bec0f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: src/gd_webp.c

+8
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,14 @@ BGD_DECLARE(void) gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
199199
quality = 80;
200200
}
201201

202+
if (overflow2(gdImageSX(im), 4)) {
203+
return;
204+
}
205+
206+
if (overflow2(gdImageSX(im) * 4, gdImageSY(im))) {
207+
return;
208+
}
209+
202210
argb = (uint8_t *)gdMalloc(gdImageSX(im) * 4 * gdImageSY(im));
203211
if (!argb) {
204212
return;

0 commit comments

Comments
 (0)