Skip to content

Commit

Permalink
avformat/oggparseogm: Check lb against psize
Browse files Browse the repository at this point in the history
No testcase, this was found during code review

Found-by: Matt Wolenetz <[email protected]>
Reviewed-by: Matt Wolenetz <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Mar 10, 2018
1 parent 010b7b3 commit 3e7c847
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libavformat/oggparseogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,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;

Expand Down

0 comments on commit 3e7c847

Please sign in to comment.