cvs: gd(GD_2_0) /libgd gd.c
[email protected] ("Nuno Lopes")
| Newsgroups | php.gd.cvs |
|---|---|
| Message-ID | <cvsnlopess1182106198@cvsserver> |
nlopess Sun Jun 17 18:49:58 2007 UTC
Modified files: (Branch: GD_2_0)
/gd/libgd gd.c
Log:
backport a missing bit of bug #41 (_gdImageFillTiled() crashed if calloc failed)
http://cvs.php.net/viewvc.cgi/gd/libgd/gd.c?r1=1.49.2.13&r2=1.49.2.14&diff_format=u
Index: gd/libgd/gd.c
diff -u gd/libgd/gd.c:1.49.2.13 gd/libgd/gd.c:1.49.2.14
--- gd/libgd/gd.c:1.49.2.13 Thu Jun 14 19:24:25 2007
+++ gd/libgd/gd.c Sun Jun 17 18:49:57 2007
@@ -1,4 +1,4 @@
-/* $Id: gd.c,v 1.49.2.13 2007/06/14 19:24:25 pajoye Exp $ */
+/* $Id: gd.c,v 1.49.2.14 2007/06/17 18:49:57 nlopess Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -2028,6 +2028,10 @@
for (i=0; i<im->sy;i++) {
pts[i] = (int *) gdCalloc(im->sx, sizeof(int));
+
+ if (!pts[i]) {
+ return;
+ }
}
stack = (struct seg *)gdMalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4));