1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Free extradata before reallocating.

Otherwise ff_alloc_extradata() just leaks any existing allocated
memory.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Dale Curtis 2017-11-21 15:10:08 -08:00 committed by Michael Niedermayer
parent b3cb9bd43f
commit 96e3407608

View File

@ -110,6 +110,7 @@ ogm_header(AVFormatContext *s, int idx)
size -= 52;
if (bytestream2_get_bytes_left(&p) < size)
return AVERROR_INVALIDDATA;
av_freep(&st->codecpar->extradata);
if (ff_alloc_extradata(st->codecpar, size) < 0)
return AVERROR(ENOMEM);
bytestream2_get_buffer(&p, st->codecpar->extradata, st->codecpar->extradata_size);