]> granicus.if.org Git - php/commitdiff
MFH
authorIlia Alshanetsky <iliaa@php.net>
Wed, 8 Jan 2003 18:11:58 +0000 (18:11 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 8 Jan 2003 18:11:58 +0000 (18:11 +0000)
ext/gd/gd.c
ext/gd/libgd/gd_io_dp.c

index efc60bca6d33f545e190871fc0f1699fa9d39061..409204e10462d33f788c7009ffc0f9523b94128a 100644 (file)
@@ -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;
 }
 /* }}} */
index c41743e78f7617b9c1fc4b866f42d8bb0f46f877..06c3ae80b63212c32b529b4fa20b39112b05cddb 100644 (file)
@@ -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;