Skip to content

Commit 49bcb1e

Browse files
committed
Add extra check for srcW/H
1 parent f26aa41 commit 49bcb1e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

ext/gd/libgd/gd.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,6 @@ static int _gdValidateCopyRectBounds(
23612361
return 1;
23622362
}
23632363

2364-
23652364
void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h)
23662365
{
23672366
if (!_gdValidateCopyRectBounds(dst, src, dstX, dstY, srcX, srcY, w, h)) {
@@ -2555,6 +2554,10 @@ void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int
25552554
return;
25562555
}
25572556

2557+
if (!_gdValidateCopyRectBounds(dst, src, dstX, dstY, srcX, srcY, srcW, srcH)) {
2558+
return;
2559+
}
2560+
25582561
int c;
25592562
int x, y;
25602563
int tox, toy;
@@ -2669,6 +2672,10 @@ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
26692672
return;
26702673
}
26712674

2675+
if (!_gdValidateCopyRectBounds(dst, src, dstX, dstY, srcX, srcY, srcW, srcH)) {
2676+
return;
2677+
}
2678+
26722679
int x, y;
26732680
double sy1, sy2, sx1, sx2;
26742681

0 commit comments

Comments
 (0)