Commit 56ffa3fe authored by Michael Niedermayer's avatar Michael Niedermayer

indeo3: Check motion vectors.

Fixes overread of reference frame.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 14aa1ba8
...@@ -584,6 +584,13 @@ static int decode_cell(Indeo3DecodeContext *ctx, AVCodecContext *avctx, ...@@ -584,6 +584,13 @@ static int decode_cell(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
/* set the pointer to the reference pixels for modes 0-4 INTER */ /* set the pointer to the reference pixels for modes 0-4 INTER */
mv_y = cell->mv_ptr[0]; mv_y = cell->mv_ptr[0];
mv_x = cell->mv_ptr[1]; mv_x = cell->mv_ptr[1];
if ( mv_x + 4*cell->xpos < 0
|| mv_y + 4*cell->ypos < 0
|| mv_x + 4*cell->xpos + 4*cell->width > plane->width
|| mv_y + 4*cell->ypos + 4*cell->height > plane->height) {
av_log(avctx, AV_LOG_ERROR, "motion vector %d %d outside reference\n", mv_x + 4*cell->xpos, mv_y + 4*cell->ypos);
return AVERROR_INVALIDDATA;
}
offset += mv_y * plane->pitch + mv_x; offset += mv_y * plane->pitch + mv_x;
ref_block = plane->pixels[ctx->buf_sel ^ 1] + offset; ref_block = plane->pixels[ctx->buf_sel ^ 1] + offset;
} }
......
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