diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-03-09 01:05:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-07-10 01:18:52 +0200 |
commit | 6b51dc9223460b40b14c2c61187b135fb690ebb7 (patch) | |
tree | 4e7642839a5dbf77df0e349297d41094082775cf | |
parent | 31783dc5fe00335f82df16ba37f83a9b9751c004 (diff) | |
download | ffmpeg-6b51dc9223460b40b14c2c61187b135fb690ebb7.tar.gz |
avformat/oggparseogm: Check lb against psize
No testcase, this was found during code review
Found-by: Matt Wolenetz <wolenetz@google.com>
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e7c847aaf5a298b62afae12b4ecfb8e12385998)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/oggparseogm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c index f03dedaf2c..573fb99dd0 100644 --- a/libavformat/oggparseogm.c +++ b/libavformat/oggparseogm.c @@ -170,6 +170,9 @@ ogm_packet(AVFormatContext *s, int idx) os->pflags |= AV_PKT_FLAG_KEY; lb = ((*p & 2) << 1) | ((*p >> 6) & 3); + if (os->psize < lb + 1) + return AVERROR_INVALIDDATA; + os->pstart += lb + 1; os->psize -= lb + 1; |