]> git.sesse.net Git - ffmpeg/commitdiff
avformat/svag: fix division by zero
authorJames Almer <jamrial@gmail.com>
Tue, 29 Mar 2016 00:34:08 +0000 (21:34 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 29 Mar 2016 00:34:08 +0000 (21:34 -0300)
Fixes ticket #5386

Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/svag.c

index ab7f36c81abcf59ecb76d52c7c9d676b1619b1f3..08fc06b1ba894a2b1ca1098f8f78eada282d97b5 100644 (file)
@@ -48,7 +48,7 @@ static int svag_read_header(AVFormatContext *s)
     if (st->codec->sample_rate <= 0)
         return AVERROR_INVALIDDATA;
     st->codec->channels    = avio_rl32(s->pb);
-    if (st->codec->channels <= 0)
+    if (st->codec->channels <= 0 || st->codec->channels > 8)
         return AVERROR_INVALIDDATA;
     st->duration           = size / (16 * st->codec->channels) * 28;
     align                  = avio_rl32(s->pb);