summaryrefslogtreecommitdiff
path: root/ext/standard/image.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-09-02 23:33:43 +0200
committerAnatol Belski <ab@php.net>2016-09-02 23:33:43 +0200
commite4564e4b985cc9cf4e53eca3152b869843247cf2 (patch)
tree55d53e9ee267001b3c2821e5b40a53bd022232fd /ext/standard/image.c
parent93bb7794332631193e37ade68141c3c39f80c355 (diff)
downloadphp-git-e4564e4b985cc9cf4e53eca3152b869843247cf2.tar.gz
improve fix
Diffstat (limited to 'ext/standard/image.c')
-rw-r--r--ext/standard/image.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/standard/image.c b/ext/standard/image.c
index c5616d1119..480246ab97 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -207,18 +207,16 @@ static struct gfxinfo *php_handle_swc(php_stream * stream)
unsigned char *b, *buf = NULL;
zend_string *bufz;
- b = ecalloc(1, len + 1);
-
if (php_stream_seek(stream, 5, SEEK_CUR)) {
- efree(b);
return NULL;
}
if (php_stream_read(stream, (char *) a, sizeof(a)) != sizeof(a)) {
- efree(b);
return NULL;
}
+ b = ecalloc(1, len + 1);
+
if (uncompress(b, &len, a, sizeof(a)) != Z_OK) {
/* failed to decompress the file, will try reading the rest of the file */
if (php_stream_seek(stream, 8, SEEK_SET)) {