Commit 140c54ea authored by Michael Niedermayer's avatar Michael Niedermayer

indeo4: better mv check

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c855ece1
......@@ -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;
}
......
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