avformat/oggparsecelt/celt_header: fix memleak
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Oct 2013 14:38:20 +0000 (16:38 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Oct 2013 14:48:51 +0000 (16:48 +0200)
Fixes: CID1108605
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/oggparsecelt.c

index 4b6233e..f3c2c1a 100644 (file)
@@ -46,7 +46,9 @@ static int celt_header(AVFormatContext *s, int idx)
         uint32_t overlap, extra_headers;
 
         priv = av_malloc(sizeof(struct oggcelt_private));
-        if (!priv || ff_alloc_extradata(st->codec, 2 * sizeof(uint32_t)))
+        if (!priv)
+            return AVERROR(ENOMEM);
+        if (ff_alloc_extradata(st->codec, 2 * sizeof(uint32_t)) < 0)
             return AVERROR(ENOMEM);
         version          = AV_RL32(p + 28);
         /* unused header size field skipped */