summaryrefslogtreecommitdiffstats
path: root/libavformat/vpk.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-06 23:17:18 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-06-14 21:36:39 +0200
commitaa003019ab9ec5ef7e7b3ff9d6262d3472b427eb (patch)
treefae36a69c54abe1f8fc7a9802d10e85eab58d4d7 /libavformat/vpk.c
parent8c6c4129b4cc3b9e0b3a527a5a15c904ec6ae3b6 (diff)
downloadffmpeg-streaming-aa003019ab9ec5ef7e7b3ff9d6262d3472b427eb.zip
ffmpeg-streaming-aa003019ab9ec5ef7e7b3ff9d6262d3472b427eb.tar.gz
avformat/vpk: Check offset for validity
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/vpk.c')
-rw-r--r--libavformat/vpk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/vpk.c b/libavformat/vpk.c
index dcc2db3..255d603 100644
--- a/libavformat/vpk.c
+++ b/libavformat/vpk.c
@@ -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);
OpenPOWER on IntegriCloud