aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-03-09 01:05:20 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-06-18 01:16:03 +0200
commit0cdc3e05cbc800c1777a9b9bdb9d3b9f4303c93d (patch)
treef6e235de890991a62ef78db0d5a3ba8080a96beb
parenta376fcaa39d0b75146637f799999736c5f98cc58 (diff)
downloadffmpeg-0cdc3e05cbc800c1777a9b9bdb9d3b9f4303c93d.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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index 4d09d174b8..03499486f7 100644
--- a/libavformat/oggparseogm.c
+++ b/libavformat/oggparseogm.c
@@ -177,6 +177,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;