[FFmpeg-cvslog] libavformat/oggparsevorbis: Fix memleak on multiple headers

Michael Niedermayer git at videolan.org
Fri Apr 13 02:57:41 EEST 2018


ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Tue Mar  6 18:14:12 2018 +0100| [6daa205cd3fe32dcf6eb61c8949fab33a3501498] | committer: Michael Niedermayer

libavformat/oggparsevorbis: Fix memleak on multiple headers

Fixes: Chromium bug 800123
Reported-by: Matt Wolenetz <wolenetz at google.com>
Reviewed-by: Matt Wolenetz <wolenetz at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 3934aa495d786845d9f541c84ee405c096938f76)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/oggparsevorbis.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 65b1998a02..572e5169ca 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -230,6 +230,10 @@ static int fixup_vorbis_headers(AVFormatContext *as,
 
     len = priv->len[0] + priv->len[1] + priv->len[2];
     buf_len = len + len / 255 + 64;
+
+    if (*buf)
+        return AVERROR_INVALIDDATA;
+
     ptr = *buf = av_realloc(NULL, buf_len);
     if (!ptr)
         return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list