4xm: check that bits per sample is strictly positive
authorAnton Khirnov <anton@khirnov.net>
Sat, 24 Aug 2013 19:30:46 +0000 (21:30 +0200)
committerAnton Khirnov <anton@khirnov.net>
Mon, 2 Sep 2013 17:28:47 +0000 (19:28 +0200)
Avoids a divide by zero.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
libavformat/4xm.c

index 614b1d5..f003c9c 100644 (file)
@@ -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;
     }