From: Ilia Alshanetsky Date: Wed, 8 Jan 2003 18:11:58 +0000 (+0000) Subject: MFH X-Git-Tag: PHP_4_3_before_13561_fix~98 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73bf754530d322ced2ed1eac6b6f6b5c09940311;p=php MFH --- diff --git a/ext/gd/gd.c b/ext/gd/gd.c index efc60bca6d..409204e104 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1129,9 +1129,9 @@ static const char php_sig_gd2[3] = {'g', 'd', '2'}; 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)) @@ -1190,7 +1190,11 @@ gdImagePtr _php_image_create_from_string(zval **data, char *tn, gdImagePtr (*ioc 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; } /* }}} */ diff --git a/ext/gd/libgd/gd_io_dp.c b/ext/gd/libgd/gd_io_dp.c index c41743e78f..06c3ae80b6 100644 --- a/ext/gd/libgd/gd_io_dp.c +++ b/ext/gd/libgd/gd_io_dp.c @@ -145,13 +145,6 @@ gdFreeDynamicCtx (struct gdIOCtx *ctx) 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;