Commit d5a35783 authored by James Almer's avatar James Almer

avformat/svag: fix division by zero

Fixes ticket #5386
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 06eef96b
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment