[FFmpeg-cvslog] avformat/mvdec: Check stream numbers
Michael Niedermayer
git at videolan.org
Fri Apr 24 02:14:01 EEST 2020
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun Feb 23 09:27:27 2020 +0100| [ae9ec86ef305091df002380b06002b6511e9436d] | committer: Michael Niedermayer
avformat/mvdec: Check stream numbers
Fixes: null pointer dereference
Fixes: 20768/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5638648978735104.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 618a9bea65112a27a106e02ada3ae475cc8ac1ac)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae9ec86ef305091df002380b06002b6511e9436d
---
libavformat/mvdec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index e3feda6687..5fa43c1ac9 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -351,6 +351,12 @@ static int mv_read_header(AVFormatContext *avctx)
if ((ret = read_table(avctx, NULL, parse_global_var)) < 0)
return ret;
+ if (mv->nb_audio_tracks < 0 || mv->nb_video_tracks < 0 ||
+ (mv->nb_audio_tracks == 0 && mv->nb_video_tracks == 0)) {
+ av_log(avctx, AV_LOG_ERROR, "Stream count is invalid.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (mv->nb_audio_tracks > 1) {
avpriv_request_sample(avctx, "Multiple audio streams support");
return AVERROR_PATCHWELCOME;
More information about the ffmpeg-cvslog
mailing list