diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-11-21 23:58:24 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-11-21 23:58:24 +0300 |
commit | 16195aad75d7350c192628d7c72c17fd44d138bd (patch) | |
tree | c4b8afdf9e9fa95a286691f83d5e7bcf0153cd06 | |
parent | 8b1bc2b075dd7ace77dc718c7ef26829f35ec091 (diff) |
avformat/vpk: check samples_per_block size
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r-- | libavformat/vpk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/vpk.c b/libavformat/vpk.c index ad60aa3d03..751904949f 100644 --- a/libavformat/vpk.c +++ b/libavformat/vpk.c @@ -62,6 +62,8 @@ static int vpk_read_header(AVFormatContext *s) if (st->codec->channels <= 0) return AVERROR_INVALIDDATA; samples_per_block = ((st->codec->block_align / st->codec->channels) * 28) / 16; + if (samples_per_block <= 0) + return AVERROR_INVALIDDATA; vpk->block_count = (st->duration + (samples_per_block - 1)) / samples_per_block; vpk->last_block_size = (st->duration % samples_per_block) * 16 * st->codec->channels / 28; avio_skip(s->pb, offset - avio_tell(s->pb)); |