Browse Source

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>
tags/n4.0
Michael Niedermayer 7 years ago
parent
commit
3934aa495d
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/oggparsevorbis.c

+ 4
- 0
libavformat/oggparsevorbis.c View File

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


Loading…
Cancel
Save