diff options
author | Dale Curtis <dalecurtis@chromium.org> | 2017-11-21 15:10:08 -0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-11-28 21:42:48 +0100 |
commit | 96e340760824e537e2d034abf9a3b8be3e2b312c (patch) | |
tree | 22ebd81055402857eeb08558513e22508f001ce6 /libavformat | |
parent | b3cb9bd43fa33a8aaf7a63e43f8418975b3bf0de (diff) | |
download | ffmpeg-96e340760824e537e2d034abf9a3b8be3e2b312c.tar.gz |
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>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/oggparseogm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c index e7a501b5a7..fad093b629 100644 --- a/libavformat/oggparseogm.c +++ b/libavformat/oggparseogm.c @@ -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); |