#21, gdImageCopyResized sanity check for allocation failures

master
pajoye 2007-01-03 20:31:29 +00:00
parent 4c8ce1020a
commit ff8afda831
2 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -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++)
{