Commit 5934d57b authored by Michael Niedermayer's avatar Michael Niedermayer

xmv: check channel number

Fixes FPE

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 08c37a10
......@@ -183,6 +183,11 @@ static int xmv_read_header(AVFormatContext *s)
packet->bits_per_sample = avio_rl16(pb);
packet->flags = avio_rl16(pb);
if (!packet->channels) {
av_log(s, AV_LOG_ERROR, "0 channels\n");
return AVERROR(EINVAL);
}
packet->bit_rate = packet->bits_per_sample *
packet->sample_rate *
packet->channels;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment