summaryrefslogtreecommitdiff
path: root/libavcodec/scpr.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2017-02-23 19:45:12 +0100
committerPaul B Mahol <onemda@gmail.com>2017-02-23 19:45:12 +0100
commit45ed942e7e166b288b6f1c262292df6a47295f6a (patch)
tree8a99bf930c22c1d8a6a50f2dc904d277d0e5ce0e /libavcodec/scpr.c
parent95a5af446bd2180a6597828152a123e4a57662ba (diff)
downloadffmpeg-45ed942e7e166b288b6f1c262292df6a47295f6a.tar.gz
avcodec/scpr: improve check for out of range motion vectors
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/scpr.c')
-rw-r--r--libavcodec/scpr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index 319057c909..5555d812e8 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -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++) {