assembling: Fix assembling of frames for non-reverse stripes

Every frame stores the delta from the previous frame, in reverse mode
it stores the delta to the next frame. This causes images to use the
wrong delta while assembling in forward mode.

The broken assembling in forward mode will create a small error for
linear motion, because the delta of all frames is approximately the
same in this case. But if you move your finger, stop and then continue
moving in a single scan, the misplaced frames should be visible in
the assembled output.

This could result in false positives and verification failing.

https://bugs.freedesktop.org/show_bug.cgi?id=105027
This commit is contained in:
Timur Celik 2018-02-10 00:37:33 +01:00 committed by Bastien Nocera
parent db34837d2d
commit 37bb59df13

View file

@ -280,11 +280,18 @@ struct fp_img *fpi_assemble_frames(struct fpi_frame_asmbl_ctx *ctx,
do {
fpi_frame = stripe->data;
y += fpi_frame->delta_y;
x += fpi_frame->delta_x;
if(reverse) {
y += fpi_frame->delta_y;
x += fpi_frame->delta_x;
}
aes_blit_stripe(ctx, img, fpi_frame, x, y);
if(!reverse) {
y += fpi_frame->delta_y;
x += fpi_frame->delta_x;
}
stripe = g_slist_next(stripe);
i++;
} while (i < stripes_len);