iliaa Wed Jan 8 13:11:41 2003 EDT Modified files: /php4/ext/gd gd.c /php4/ext/gd/libgd gd_io_dp.c Log: Fixed bug #21518. Fixed memory in leak ImageCreateFromString(). Fixed a bug that prevented proper identification of WBMP images and thus prevented ImageCreateFromString() from working on those images. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.242 php4/ext/gd/gd.c:1.243 --- php4/ext/gd/gd.c:1.242 Tue Jan 7 17:34:00 2003 +++ php4/ext/gd/gd.c Wed Jan 8 13:11:40 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.242 2003/01/07 22:34:00 pajoye Exp $ */ +/* $Id: gd.c,v 1.243 2003/01/08 18:11:40 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1212,9 +1212,9 @@ static int _php_image_type (char data[8]) { #ifdef HAVE_LIBGD15 - /* Based on ext/standard/images.c */ + /* Based on ext/standard/image.c */ - if (data == NULL || strlen(data) <= 0) + if (data == NULL) return -1; if (!memcmp(data, php_sig_gd2, 3)) @@ -1273,7 +1273,11 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed data is not in '%s' format", tn); return NULL; } - +#if HAVE_LIBGD204 + io_ctx->gd_free(io_ctx); +#else + io_ctx->free(io_ctx); +#endif return im; } /* }}} */ Index: php4/ext/gd/libgd/gd_io_dp.c diff -u php4/ext/gd/libgd/gd_io_dp.c:1.2 php4/ext/gd/libgd/gd_io_dp.c:1.3 --- php4/ext/gd/libgd/gd_io_dp.c:1.2 Tue Oct 29 18:08:01 2002 +++ php4/ext/gd/libgd/gd_io_dp.c Wed Jan 8 13:11:40 2003 @@ -145,13 +145,6 @@ gdFree (ctx); - /* clean up the data block and return it */ - if (dp->data != NULL) - { - gdFree (dp->data); - dp->data = NULL; - } - dp->realSize = 0; dp->logicalSize = 0;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php