tabe            Thu Apr 23 16:28:39 2009 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/gd/libgd       gd.c 
  Log:
  MFH: check non-null before any use.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.25&r2=1.90.2.1.2.26&diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.25 
php-src/ext/gd/libgd/gd.c:1.90.2.1.2.26
--- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.25     Sun Apr 12 14:44:34 2009
+++ php-src/ext/gd/libgd/gd.c   Thu Apr 23 16:28:39 2009
@@ -3874,16 +3874,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++) {
@@ -3940,11 +3939,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

Reply via email to