cvs: gd /libgd gd_gd.c

[email protected] ("Mattias Bengtsson") Mon, 06 Aug 2007 18:32:26 -0000
Newsgroups php.gd.cvs
Message-ID <cvsmattias1186425146@cvsserver>
mattias		Mon Aug  6 18:32:26 2007 UTC

  Modified files:              
    /gd/libgd	gd_gd.c 
  Log:
  - #101, _gdCreateFromFile() can crash if gdImageCreate fails
  
http://cvs.php.net/viewvc.cgi/gd/libgd/gd_gd.c?r1=1.11&r2=1.12&diff_format=u
Index: gd/libgd/gd_gd.c
diff -u gd/libgd/gd_gd.c:1.11 gd/libgd/gd_gd.c:1.12
--- gd/libgd/gd_gd.c:1.11	Wed Apr  5 15:52:22 2006
+++ gd/libgd/gd_gd.c	Mon Aug  6 18:32:26 2007
@@ -149,6 +149,10 @@
     {
       im = gdImageCreate (*sx, *sy);
     }
+  if (!im)
+  	{
+		goto fail1;
+	}
   if (!_gdGetColors (in, im, gd2xFlag))
     {
       goto fail2;