[FFmpeg-cvslog] avformat/vpk: Check offset for validity
Michael Niedermayer
git at videolan.org
Thu Jun 27 20:48:57 EEST 2019
ffmpeg | branch: release/4.1 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jun 6 23:17:18 2019 +0200| [e73ef454e89dcce85fbc8c12ccb5c6b73c7a343c] | committer: Michael Niedermayer
avformat/vpk: Check offset for validity
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit aa003019ab9ec5ef7e7b3ff9d6262d3472b427eb)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e73ef454e89dcce85fbc8c12ccb5c6b73c7a343c
---
libavformat/vpk.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/vpk.c b/libavformat/vpk.c
index 0a058b9d7f..64a0d56926 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);
More information about the ffmpeg-cvslog
mailing list