[FFmpeg-cvslog] Free extradata before reallocating.

Dale Curtis git at videolan.org
Tue Nov 28 22:44:24 EET 2017


ffmpeg | branch: master | Dale Curtis <dalecurtis at chromium.org> | Tue Nov 21 15:10:08 2017 -0800| [96e340760824e537e2d034abf9a3b8be3e2b312c] | committer: Michael Niedermayer

Free extradata before reallocating.

Otherwise ff_alloc_extradata() just leaks any existing allocated
memory.

Signed-off-by: Dale Curtis <dalecurtis at chromium.org>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=96e340760824e537e2d034abf9a3b8be3e2b312c
---

 libavformat/oggparseogm.c | 1 +
 1 file changed, 1 insertion(+)

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);



More information about the ffmpeg-cvslog mailing list