summaryrefslogtreecommitdiff
path: root/libavformat/wavdec.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2014-08-18 03:14:01 -0300
committerMichael Niedermayer <michaelni@gmx.at>2014-08-18 09:29:25 +0200
commit853c1fb66835123c87178420816cff58c18548ed (patch)
tree6a01009de4471e95820afe4758ef9fd6b29c49ff /libavformat/wavdec.c
parent44e95a017c8fa0c3d019cc91c716ba876f931fe7 (diff)
lavf/wavdec: add sanity check for AVCodecContext.channels
Fixes ticket #3862. As a side effect, this also fixes aac_latm in wav. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/wavdec.c')
-rw-r--r--libavformat/wavdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 7e0d5f48de..9c4e2dfa14 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -402,7 +402,8 @@ break_loop:
avio_seek(pb, data_ofs, SEEK_SET);
- if (data_size > 0 && sample_count && data_size / sample_count / st->codec->channels > 8) {
+ if ( data_size > 0 && sample_count && st->codec->channels
+ && data_size / sample_count / st->codec->channels > 8) {
av_log(s, AV_LOG_WARNING, "ignoring wrong sample_count %"PRId64"\n", sample_count);
sample_count = 0;
}