[libav-stable] 4xm: check that bits per sample is strictly positive

Anton Khirnov git at libav.org
Mon Sep 2 19:48:43 CEST 2013


Module: libav
Branch: master
Commit: a7c1689dedd11689edb30088d467ac03f9b8d1cf

Author:    Anton Khirnov <anton at khirnov.net>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Sat Aug 24 21:30:46 2013 +0200

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

---

 libavformat/4xm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 614b1d5..f003c9c 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -146,7 +146,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 libav-stable mailing list