tiff: fix memleak
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 3 Jun 2013 12:40:15 +0000 (14:40 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 3 Jun 2013 12:59:52 +0000 (14:59 +0200)
Fixes CID1026764
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/tiff.c

index 9a2139f..48807fa 100644 (file)
@@ -453,8 +453,10 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
         if (!zbuf)
             return AVERROR(ENOMEM);
         if (s->fill_order) {
-            if ((ret = deinvert_buffer(s, src, size)) < 0)
+            if ((ret = deinvert_buffer(s, src, size)) < 0) {
+                av_free(zbuf);
                 return ret;
+            }
             ssrc = src = s->deinvert_buf;
         }
         ret = tiff_uncompress(zbuf, &outlen, src, size);