mirror of https://git.ffmpeg.org/ffmpeg.git
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:
parent
b3cb9bd43f
commit
96e3407608
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue