[FFmpeg-cvslog] 4xm: check that bits per sample is strictly positive

Anton Khirnov git at videolan.org
Sat Sep 7 14:25:47 CEST 2013


ffmpeg | branch: release/1.1 | Anton Khirnov <anton at khirnov.net> | Sat Aug 24 21:30:46 2013 +0200| [f3c7e604fabd1505c7de3eaddee5a24b8aacf4c3] | committer: Luca Barbato

4xm: check that bits per sample is strictly positive

Avoids a divide by zero.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit a7c1689dedd11689edb30088d467ac03f9b8d1cf)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

 libavformat/4xm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index c0b3914..5fb1921 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -154,7 +154,7 @@ static int parse_strk(AVFormatContext *s,
 
     if (fourxm->tracks[track].channels    <= 0 ||
         fourxm->tracks[track].sample_rate <= 0 ||
-        fourxm->tracks[track].bits        < 0) {
+        fourxm->tracks[track].bits        <= 0) {
         av_log(s, AV_LOG_ERROR, "audio header invalid\n");
         return AVERROR_INVALIDDATA;
     }



More information about the ffmpeg-cvslog mailing list