diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-23 10:31:45 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-23 10:31:45 +0100 |
commit | 5934d57ba99b3dab4dfe98472ac6b30b9cf6329a (patch) | |
tree | 89a2cca4210d9240e9be7b42447fbd0844336650 /libavformat | |
parent | 08c37a10e9ef7e30d7b7a889ad28c7fa9c49c886 (diff) | |
download | ffmpeg-5934d57ba99b3dab4dfe98472ac6b30b9cf6329a.tar.gz |
xmv: check channel number
Fixes FPE
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/xmv.c | 5 |
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; |