1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

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 3934aa495d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2018-03-06 18:14:12 +01:00
parent 6d3f8992ac
commit 5279e86596

View File

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