Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-03-06 20:14:12 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2018-04-13 01:35:15 +0300
commit6daa205cd3fe32dcf6eb61c8949fab33a3501498 (patch)
tree88ae0c3530d5a4919b7a5864f2baa1a35572c88d /libavformat/oggparsevorbis.c
parente908a595db8e254629cb1275fb9e17099dd2efab (diff)
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>
Diffstat (limited to 'libavformat/oggparsevorbis.c')
-rw-r--r--libavformat/oggparsevorbis.c4
1 files changed, 4 insertions, 0 deletions
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);