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:
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
Block a user