mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/vqf: check number of channels before use.
Fixes division by zero Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
9dd04f6d8c
commit
a527e69259
@ -132,6 +132,11 @@ static int vqf_read_header(AVFormatContext *s)
|
||||
rate_flag = AV_RB32(comm_chunk + 8);
|
||||
avio_skip(s->pb, len-12);
|
||||
|
||||
if (st->codec->channels <= 0) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid number of channels\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
st->codec->bit_rate = read_bitrate*1000;
|
||||
break;
|
||||
case MKTAG('D','S','I','Z'): // size of compressed data
|
||||
|
Loading…
Reference in New Issue
Block a user