#21, gdImageCopyResized sanity check for allocation failures
parent
4c8ce1020a
commit
ff8afda831
|
@ -42,3 +42,4 @@ GDBUGS NEWS
|
|||
#18, Removed invalid gdFree call when overflow2 fails
|
||||
#19, Use abs instead of fbas in HWB_Diff (Nick Atty)
|
||||
#20, Fixed gdImageCopyMergeGray when used with a true color image
|
||||
#21, gdImageCopyResized sanity check for allocation failures
|
||||
|
|
8
src/gd.c
8
src/gd.c
|
@ -2274,7 +2274,15 @@ BGD_DECLARE(void) gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX,
|
|||
return;
|
||||
}
|
||||
stx = (int *) gdMalloc (sizeof (int) * srcW);
|
||||
if (!stx) {
|
||||
return;
|
||||
}
|
||||
|
||||
sty = (int *) gdMalloc (sizeof (int) * srcH);
|
||||
if (!sty) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Fixed by Mao Morimoto 2.0.16 */
|
||||
for (i = 0; (i < srcW); i++)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue