aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-11-07 13:48:24 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-13 23:39:50 +0200
commit54d7297b338a6c507cb4f9c98789e5a2ec1fe0f5 (patch)
treec79fddc7ab786d45a9a62896f384f4c160b47c95
parentf486033934426e435e8c21d9eb0d5cfee39d0ab0 (diff)
downloadffmpeg-54d7297b338a6c507cb4f9c98789e5a2ec1fe0f5.tar.gz
avformat/mov: Check channels for mov_parse_stsd_audio()
Fixes: signed integer overflow: -776522110086937600 * 16 cannot be represented in type 'long' Fixes: 40563/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6644829447127040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 3a64a4c58255d45e05eff80c9464ad3bdc2d6463) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index f081ced86e..3ec6e91098 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2324,6 +2324,10 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
av_log(c->fc, AV_LOG_ERROR, "Invalid sample rate %d\n", st->codecpar->sample_rate);
return AVERROR_INVALIDDATA;
}
+ if (st->codecpar->channels < 0) {
+ av_log(c->fc, AV_LOG_ERROR, "Invalid channels %d\n", st->codecpar->channels);
+ return AVERROR_INVALIDDATA;
+ }
} else if (st->codecpar->codec_type==AVMEDIA_TYPE_SUBTITLE){
st->codecpar->codec_id = id;
mov_parse_stsd_subtitle(c, pb, st, sc,