[FFmpeg-cvslog] lavf/wavdec: add sanity check for AVCodecContext.channels

James Almer git at videolan.org
Mon Aug 18 09:41:52 CEST 2014


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Aug 18 03:14:01 2014 -0300| [853c1fb66835123c87178420816cff58c18548ed] | committer: Michael Niedermayer

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 at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=853c1fb66835123c87178420816cff58c18548ed
---

 libavformat/wavdec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 7e0d5f4..9c4e2df 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;
     }



More information about the ffmpeg-cvslog mailing list