aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-03-06 18:14:12 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-10 01:18:52 +0200
commit5279e865961f6eb7bf05c46c6c59835000f5bd50 (patch)
tree561a45a03e733e7d4fd3919699fb5a7ef053d8e0
parent6d3f8992acc9de0af0bfae5a8844c87747d92ad0 (diff)
downloadffmpeg-5279e865961f6eb7bf05c46c6c59835000f5bd50.tar.gz
libavformat/oggparsevorbis: Fix memleak on multiple headers
Fixes: Chromium bug 800123 Reported-by: Matt Wolenetz <wolenetz@google.com> Reviewed-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 3934aa495d786845d9f541c84ee405c096938f76) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/oggparsevorbis.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 59e7b75522..5ca3b9eeeb 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -228,6 +228,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);