X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Foggparseogm.c;h=a07453760b710be903313e7952a72a2773a8c943;hb=7b6b8c92652d6683d97515352e4a9a4147b7da7c;hp=4b4edf26ca36fc9e8fe2617edc5b83435991cf2f;hpb=010b7b30b721b90993e05e9ee6338e88bb8debb3;p=ffmpeg diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c index 4b4edf26ca3..a07453760b7 100644 --- a/libavformat/oggparseogm.c +++ b/libavformat/oggparseogm.c @@ -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;