summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/xmv.c5
1 files changed, 5 insertions, 0 deletions
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;