Commit 9959a52b authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

astdec: fix division by zero

Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 923488bd
......@@ -90,7 +90,7 @@ static int ast_read_packet(AVFormatContext *s, AVPacket *pkt)
pos = avio_tell(s->pb);
type = avio_rl32(s->pb);
size = avio_rb32(s->pb);
if (size > INT_MAX / s->streams[0]->codecpar->channels)
if (!s->streams[0]->codecpar->channels || size > INT_MAX / s->streams[0]->codecpar->channels)
return AVERROR_INVALIDDATA;
size *= s->streams[0]->codecpar->channels;
......
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