avformat/svag: fix division by zero
Fixes ticket #5386 Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit d5a3578350a3901a26df39df196bb085760ec46f)
This commit is contained in:
parent
3d9ebfd272
commit
7b1e020fc5
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user