diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-03-06 18:14:12 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-03-07 20:37:33 +0100 |
commit | 3934aa495d786845d9f541c84ee405c096938f76 (patch) | |
tree | b0f89a5ee616d2a1079c6087171e66b16f78d3eb | |
parent | 367929bed9def1ccdd9a0f4ac5b7b98d1993782d (diff) | |
download | ffmpeg-3934aa495d786845d9f541c84ee405c096938f76.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>
-rw-r--r-- | libavformat/oggparsevorbis.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 29b1ab514e..bcfd246b8d 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); |