From 853c1fb66835123c87178420816cff58c18548ed Mon Sep 17 00:00:00 2001 From: James Almer Date: Mon, 18 Aug 2014 03:14:01 -0300 Subject: [PATCH] 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 Signed-off-by: Michael Niedermayer --- libavformat/wavdec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }