aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-12-09 00:49:29 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:19 +0200
commita4be820f99e2c47c0b44ddd2f6e0dabe85f67c0a (patch)
treeab4bef415fbe28d17634536f3de086db8db763fd
parent896720925a014c891d2e6a9e3e33a5fa6b0fc40c (diff)
downloadffmpeg-a4be820f99e2c47c0b44ddd2f6e0dabe85f67c0a.tar.gz
avformat/rpl: Check the number of streams
Fixes: out of memory access Fixes: 27787/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-4743666463408128.fuzz 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 0677bdb1f522d0d25b47bca3d8e09ece83083678) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/rpl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/rpl.c b/libavformat/rpl.c
index a794d3b485..d3f2ca2f35 100644
--- a/libavformat/rpl.c
+++ b/libavformat/rpl.c
@@ -230,6 +230,9 @@ static int rpl_read_header(AVFormatContext *s)
error |= read_line(pb, line, sizeof(line));
}
+ if (s->nb_streams == 0)
+ return AVERROR_INVALIDDATA;
+
rpl->frames_per_chunk = read_line_and_int(pb, &error); // video frames per chunk
if (rpl->frames_per_chunk > 1 && vst->codecpar->codec_tag != 124)
av_log(s, AV_LOG_WARNING,