diff options
author | Dale Curtis <dalecurtis@chromium.org> | 2017-11-22 02:10:08 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-11-28 23:42:48 +0300 |
commit | 96e340760824e537e2d034abf9a3b8be3e2b312c (patch) | |
tree | 22ebd81055402857eeb08558513e22508f001ce6 | |
parent | b3cb9bd43fa33a8aaf7a63e43f8418975b3bf0de (diff) |
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>
-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); |