avformat/oggparsecelt: fix memleak
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 26 Apr 2014 19:31:15 +0000 (21:31 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 26 Apr 2014 19:31:15 +0000 (21:31 +0200)
Fixes: CID1108605

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/oggparsecelt.c

index f3c2c1a..d6e9962 100644 (file)
@@ -48,8 +48,10 @@ static int celt_header(AVFormatContext *s, int idx)
         priv = av_malloc(sizeof(struct oggcelt_private));
         if (!priv)
             return AVERROR(ENOMEM);
-        if (ff_alloc_extradata(st->codec, 2 * sizeof(uint32_t)) < 0)
+        if (ff_alloc_extradata(st->codec, 2 * sizeof(uint32_t)) < 0) {
+            av_free(priv);
             return AVERROR(ENOMEM);
+        }
         version          = AV_RL32(p + 28);
         /* unused header size field skipped */
         sample_rate      = AV_RL32(p + 36);