tabe Thu Apr 23 16:25:17 2009 UTC Modified files: /php-src/ext/gd/libgd gd.c Log: check non-null before any use. http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.120&r2=1.121&diff_format=u Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.120 php-src/ext/gd/libgd/gd.c:1.121 --- php-src/ext/gd/libgd/gd.c:1.120 Sun Apr 12 14:45:05 2009 +++ php-src/ext/gd/libgd/gd.c Thu Apr 23 16:25:17 2009 @@ -3873,16 +3873,15 @@ /* We need the orinal image with each safe neoghb. pixel */ srcback = gdImageCreateTrueColor (src->sx, src->sy); + if (srcback==NULL) { + return 0; + } srcback->saveAlphaFlag = 1; srctrans = gdImageColorAllocateAlpha(srcback, 0, 0, 0, 127); gdImageFill(srcback, 0, 0, srctrans); gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy); - if (srcback==NULL) { - return 0; - } - f = GET_PIXEL_FUNCTION(src); for ( y=0; y<src->sy; y++) { @@ -3939,11 +3938,10 @@ /* We need the orinal image with each safe neoghb. pixel */ srcback = gdImageCreateTrueColor (src->sx, src->sy); - gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy); - if (srcback==NULL) { return 0; } + gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy); f = GET_PIXEL_FUNCTION(src);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php