avformat/vividas: Check number of audio channels

Fixes: division by 0
Fixes: 28597/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5752201490333696

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 66deab3a26)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-12-26 11:50:28 +01:00
parent 273f53e57d
commit 7ce729649f
1 changed files with 1 additions and 1 deletions

View File

@ -368,7 +368,7 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *
avio_rl16(pb); //codec_subid
st->codecpar->channels = avio_rl16(pb); // channels
st->codecpar->sample_rate = avio_rl32(pb); // sample_rate
if (st->codecpar->sample_rate <= 0)
if (st->codecpar->sample_rate <= 0 || st->codecpar->channels <= 0)
return AVERROR_INVALIDDATA;
avio_seek(pb, 10, SEEK_CUR); // data_1
q = avio_r8(pb);