diff --git a/libavformat/xmv.c b/libavformat/xmv.c index 110103ea69..596da5fb63 100644 --- a/libavformat/xmv.c +++ b/libavformat/xmv.c @@ -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;