aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-10 23:09:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-09-04 20:26:35 +0200
commitf5c6f81576928c7d5b219a7e8f49718fa7a0874c (patch)
tree1aa06c61b24fe4feb3a95b5f71df8987d00993be /libavformat
parent4eef201e151ba54310d3fbf8e5d14c70dcc91238 (diff)
downloadffmpeg-f5c6f81576928c7d5b219a7e8f49718fa7a0874c.tar.gz
avformat/vividas: Fix infinite loop in header parser
Fixes: Timeout (Infinite -> Finite) Fixes: 16010/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5638616102993920 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 52b564ef13237bfbb31a4103d29828dba9d14984) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/vividas.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index e70c9164a1..a5f33181de 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -546,6 +546,9 @@ static int viv_read_header(AVFormatContext *s)
break;
block_len = ffio_read_varlen(pb);
+ if (avio_feof(pb))
+ return AVERROR_INVALIDDATA;
+
block_type = avio_r8(pb);
if (block_type == 22) {