[FFmpeg-devel] [PATCH] avformat/oggparsevorbis: Error out on double init of vp

Michael Niedermayer michael at niedermayer.cc
Mon Jan 13 11:59:33 EET 2020


Fixes: memleak
Fixes: 19949/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5743636058210304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/oggparsevorbis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 43f05f928a..889c7950d3 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -230,7 +230,7 @@ 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)
+    if (*buf || priv->vp)
         return AVERROR_INVALIDDATA;
 
     ptr = *buf = av_realloc(NULL, buf_len);
-- 
2.24.0



More information about the ffmpeg-devel mailing list