cws2fws: check inflateInit return value
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Oct 2012 15:27:53 +0000 (17:27 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Oct 2012 16:24:50 +0000 (18:24 +0200)
Fixes CID733722
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tools/cws2fws.c

index 74588c1..8dc285b 100644 (file)
@@ -79,7 +79,10 @@ int main(int argc, char *argv[])
     zstream.zalloc = NULL;
     zstream.zfree  = NULL;
     zstream.opaque = NULL;
-    inflateInit(&zstream);
+    if (inflateInit(&zstream) != Z_OK) {
+        fprintf(stderr, "inflateInit failed\n");
+        return 1;
+    }
 
     for (i = 0; i < comp_len - 8;) {
         int ret, len = read(fd_in, &buf_in, 1024);