Browse Source

avformat/vpk: Check offset for validity

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit aa003019ab)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.1.4
Michael Niedermayer 6 years ago
parent
commit
e73ef454e8
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavformat/vpk.c

+ 3
- 0
libavformat/vpk.c View File

@@ -66,6 +66,9 @@ static int vpk_read_header(AVFormatContext *s)
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->codecpar->channels / 28;

if (offset < avio_tell(s->pb))
return AVERROR_INVALIDDATA;
avio_skip(s->pb, offset - avio_tell(s->pb));
avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);



Loading…
Cancel
Save