From 37bb59df131503b2853427053b20b5c90349e1ed Mon Sep 17 00:00:00 2001 From: Timur Celik Date: Sat, 10 Feb 2018 00:37:33 +0100 Subject: [PATCH] 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 --- libfprint/assembling.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libfprint/assembling.c b/libfprint/assembling.c index 2c4ccc6..ec37a25 100644 --- a/libfprint/assembling.c +++ b/libfprint/assembling.c @@ -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); -- 2.17.0