avformat/oggparseopus: Free opus extradata before reallocating.
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>
This commit is contained in:
committed by
Michael Niedermayer
parent
86cead5256
commit
a3a0b5bd0a
@@ -62,6 +62,7 @@ static int opus_header(AVFormatContext *avf, int idx)
|
|||||||
/*gain = AV_RL16(packet + 16);*/
|
/*gain = AV_RL16(packet + 16);*/
|
||||||
/*channel_map = AV_RL8 (packet + 18);*/
|
/*channel_map = AV_RL8 (packet + 18);*/
|
||||||
|
|
||||||
|
av_freep(&st->codecpar->extradata);
|
||||||
if (ff_alloc_extradata(st->codecpar, os->psize))
|
if (ff_alloc_extradata(st->codecpar, os->psize))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user