diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-04-27 18:01:51 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-05-03 19:21:45 +0200 |
commit | d8745de6ae6c6272fb33f696842cedae2c3eaad1 (patch) | |
tree | 033f16b772d8512e9edcab0763923f6c620e659d | |
parent | 46fd6e4f2ebbcd5a00847cdb05fe416466d06d37 (diff) | |
download | ffmpeg-d8745de6ae6c6272fb33f696842cedae2c3eaad1.tar.gz |
indeo3: fix off by one in MV validity check
CC:libav-stable@libav.org
(cherry picked from commit 95220be1faac628d849a004644c0d102df0aa98b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | libavcodec/indeo3.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index eacd15043a..f2f7c09d98 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -236,8 +236,8 @@ static int copy_cell(Indeo3DecodeContext *ctx, Plane *plane, Cell *cell) /* -1 because there is an extra line on top for prediction */ if ((cell->ypos << 2) + mv_y < -1 || (cell->xpos << 2) + mv_x < 0 || - ((cell->ypos + cell->height) << 2) + mv_y >= plane->height || - ((cell->xpos + cell->width) << 2) + mv_x >= plane->width) { + ((cell->ypos + cell->height) << 2) + mv_y > plane->height || + ((cell->xpos + cell->width) << 2) + mv_x > plane->width) { av_log(ctx->avctx, AV_LOG_ERROR, "Motion vectors point out of the frame.\n"); return AVERROR_INVALIDDATA; @@ -607,8 +607,8 @@ static int decode_cell(Indeo3DecodeContext *ctx, AVCodecContext *avctx, /* -1 because there is an extra line on top for prediction */ if ((cell->ypos << 2) + mv_y < -1 || (cell->xpos << 2) + mv_x < 0 || - ((cell->ypos + cell->height) << 2) + mv_y >= plane->height || - ((cell->xpos + cell->width) << 2) + mv_x >= plane->width) { + ((cell->ypos + cell->height) << 2) + mv_y > plane->height || + ((cell->xpos + cell->width) << 2) + mv_x > plane->width) { av_log(ctx->avctx, AV_LOG_ERROR, "Motion vectors point out of the frame.\n"); return AVERROR_INVALIDDATA; |