[FFmpeg-cvslog] avformat/vqf: check number of channels before use.

Michael Niedermayer git at videolan.org
Tue May 7 22:32:07 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue May  7 22:26:22 2013 +0200| [a527e692592b7eef69430cc866bb96231526316c] | committer: Michael Niedermayer

avformat/vqf: check number of channels before use.

Fixes division by zero

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/vqf.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index ed58828..1ce5359 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -132,6 +132,11 @@ static int vqf_read_header(AVFormatContext *s)
             rate_flag           = AV_RB32(comm_chunk + 8);
             avio_skip(s->pb, len-12);
 
+            if (st->codec->channels <= 0) {
+                av_log(s, AV_LOG_ERROR, "Invalid number of channels\n");
+                return AVERROR_INVALIDDATA;
+            }
+
             st->codec->bit_rate              = read_bitrate*1000;
             break;
         case MKTAG('D','S','I','Z'): // size of compressed data



More information about the ffmpeg-cvslog mailing list