Commit 96e34076 authored by Dale Curtis's avatar Dale Curtis Committed by Michael Niedermayer

Free extradata before reallocating.

Otherwise ff_alloc_extradata() just leaks any existing allocated
memory.
Signed-off-by: 's avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent b3cb9bd4
...@@ -110,6 +110,7 @@ ogm_header(AVFormatContext *s, int idx) ...@@ -110,6 +110,7 @@ ogm_header(AVFormatContext *s, int idx)
size -= 52; size -= 52;
if (bytestream2_get_bytes_left(&p) < size) if (bytestream2_get_bytes_left(&p) < size)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
av_freep(&st->codecpar->extradata);
if (ff_alloc_extradata(st->codecpar, size) < 0) if (ff_alloc_extradata(st->codecpar, size) < 0)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
bytestream2_get_buffer(&p, st->codecpar->extradata, st->codecpar->extradata_size); bytestream2_get_buffer(&p, st->codecpar->extradata, st->codecpar->extradata_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment