diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-16 22:24:42 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-16 22:24:42 +0100 |
commit | 6c0c799bd5869b3baccb57012d69490a0b35c62b (patch) | |
tree | e26421c1bc5136cf9e09020543f7ddf807ee02e5 /libavformat/xwma.c | |
parent | d1c7a7776f6775cf43c3a5025d0544f0470125f4 (diff) | |
parent | 5e8243e843be8f71da7dde199a71d095726533eb (diff) | |
download | ffmpeg-6c0c799bd5869b3baccb57012d69490a0b35c62b.tar.gz |
Merge commit '5e8243e843be8f71da7dde199a71d095726533eb' into release/0.10
* commit '5e8243e843be8f71da7dde199a71d095726533eb':
bfi: Avoid divisions by zero
electronicarts: Add more sanity checking for the number of channels
riffdec: Add sanity checks for the sample rate
mvi: Add sanity checking for the audio frame size
xwma: Avoid division by zero
avidec: Make sure a packet is large enough before reading its data
vqf: Make sure the bitrate is in the valid range
vqf: Make sure sample_rate is set to a valid value
vc1dec: Undo mpegvideo initialization if unable to allocate tables
Conflicts:
libavformat/riff.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/xwma.c')
-rw-r--r-- | libavformat/xwma.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/xwma.c b/libavformat/xwma.c index 44de49a159..551099e8b3 100644 --- a/libavformat/xwma.c +++ b/libavformat/xwma.c @@ -200,6 +200,14 @@ static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap) /* Estimate the duration from the total number of output bytes. */ const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1]; + + if (!bytes_per_sample) { + av_log(s, AV_LOG_ERROR, + "Invalid bits_per_coded_sample %d for %d channels\n", + st->codec->bits_per_coded_sample, st->codec->channels); + return AVERROR_INVALIDDATA; + } + st->duration = total_decoded_bytes / bytes_per_sample; /* Use the dpds data to build a seek table. We can only do this after |