Fixed memory in leak ImageCreateFromString().
Fixed a bug that prevented proper identification of WBMP images and thus
prevented ImageCreateFromString() from working on those images.
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))
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;
}
/* }}} */
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;