Commit 45ed942e authored by Paul B Mahol's avatar Paul B Mahol

avcodec/scpr: improve check for out of range motion vectors

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 95a5af44
......@@ -504,7 +504,8 @@ static int decompress_p(AVCodecContext *avctx,
mvx -= 256;
mvy -= 256;
if (by + mvy + sy1 < 0 || bx + mvx + sx1 < 0)
if (by + mvy + sy1 < 0 || bx + mvx + sx1 < 0 ||
by + mvy + sy1 >= avctx->height || bx + mvx + sx1 >= avctx->width)
return AVERROR_INVALIDDATA;
for (i = 0; i < sy2 - sy1 && (by + sy1 + i) < avctx->height; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment