Commit 16195aad authored by Paul B Mahol's avatar Paul B Mahol

avformat/vpk: check samples_per_block size

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 8b1bc2b0
......@@ -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));
......
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