diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-10-16 22:39:47 +0200 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-11-27 00:28:02 +0100 |
commit | b3991ccd1170d84f5b5d84566b0c78a42724a073 (patch) | |
tree | 482597c064cc45dc73d886b9dc44bd0ab893a593 | |
parent | 230c04e3f6d720cc7fa17735b2ef91570417964d (diff) | |
download | ffmpeg-b3991ccd1170d84f5b5d84566b0c78a42724a073.tar.gz |
astdec: fix division by zero
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9959a52b14bcfa3e5baeb3fc8a86c04bbc0d3d5d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r-- | libavformat/astdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/astdec.c b/libavformat/astdec.c index f3ca721ccf..7a53d0bb70 100644 --- a/libavformat/astdec.c +++ b/libavformat/astdec.c @@ -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; |