avformat/oggparseopus: Free opus extradata before reallocating.
authorDale Curtis <dalecurtis@chromium.org>
Tue, 28 Nov 2017 21:44:49 +0000 (13:44 -0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 29 Nov 2017 03:47:28 +0000 (04:47 +0100)
Otherwise ff_alloc_extradata() just leaks any existing allocated
memory.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/oggparseopus.c

index f45ad84..cd34cf2 100644 (file)
@@ -62,6 +62,7 @@ static int opus_header(AVFormatContext *avf, int idx)
         /*gain                = AV_RL16(packet + 16);*/
         /*channel_map         = AV_RL8 (packet + 18);*/
 
+        av_freep(&st->codecpar->extradata);
         if (ff_alloc_extradata(st->codecpar, os->psize))
             return AVERROR(ENOMEM);