diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-26 03:46:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-26 03:46:06 +0200 |
commit | 140c54ea0b1a6b4eb2d8515624a616565763e26a (patch) | |
tree | 147a36f03a662012e5bcb6ed156c9bc4f7fc1695 /libavcodec/indeo4.c | |
parent | c855ece101cd960ddd20eabd5f295e0b02b71dcc (diff) | |
download | ffmpeg-140c54ea0b1a6b4eb2d8515624a616565763e26a.tar.gz |
indeo4: better mv check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/indeo4.c')
-rw-r--r-- | libavcodec/indeo4.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 1265201541..a3e2456ad0 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -569,10 +569,10 @@ static int decode_mb_info(IVI4DecContext *ctx, IVIBandDesc *band, s= band->is_halfpel; if (mb->type) - if ( x + (mv_x >>s) + (y+ (mv_y >>s))*band->pitch < 0 || - x + ((mv_x+s)>>s) + band->mb_size - 1 - + (y+band->mb_size - 1 +((mv_y+s)>>s))*band->pitch > band->height*band->pitch -1) { - av_log(avctx, AV_LOG_ERROR, "motion vector %d %d outside reference\n", x*s + mv_x, y*s + mv_y); + if ( x + (mb->mv_x >>s) + (y+ (mb->mv_y >>s))*band->pitch < 0 || + x + ((mb->mv_x+s)>>s) + band->mb_size - 1 + + (y+band->mb_size - 1 +((mb->mv_y+s)>>s))*band->pitch > band->bufsize -1) { + av_log(avctx, AV_LOG_ERROR, "motion vector %d %d outside reference\n", x*s + mb->mv_x, y*s + mb->mv_y); return AVERROR_INVALIDDATA; } |