1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-28 12:32:17 +02:00

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>
This commit is contained in:
Michael Niedermayer 2018-03-09 01:05:20 +01:00
parent 31783dc5fe
commit 6b51dc9223

View File

@ -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;