diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-11-07 15:48:24 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-04-07 17:26:59 +0300 |
commit | 498a365d6d5d994e33e7d4d0d052d0905e749b23 (patch) | |
tree | e1e5e0e8464dddd618579f50f91ad34702b2b08c /libavformat/mov.c | |
parent | 208434c1640a0d069f5d804a35c5c38e66e88d64 (diff) |
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>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 0962eda774..6c72c52fdb 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2525,6 +2525,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){ mov_parse_stsd_subtitle(c, pb, st, sc, size - (avio_tell(pb) - start_pos)); |