From 9bf19b5e4798f565a31fcc613dfae1a0c69cad69 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Fri, 23 Nov 2012 00:17:57 +0300 Subject: [PATCH 8/9] Add a workaround for bug in MINDTCT MINDTCT crashes if image is too small. It happens mostly on swipe scanners when scan was too short. Check that image height is not less than image width (it's true on AES2501, AES2550 and AES1660 devices) --- libfprint/imgdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libfprint/imgdev.c b/libfprint/imgdev.c index 14e41ae..9985941 100644 --- a/libfprint/imgdev.c +++ b/libfprint/imgdev.c @@ -113,6 +113,11 @@ static int sanitize_image(struct fp_img_dev *imgdev, struct fp_img **_img) return -EINVAL; } + if ((drv->scan_type == FP_SCAN_TYPE_SWIPE) && (img->height < img->width)) { + fp_err("on swipe scanner image height should be not less than image width"); + return -EINVAL; + } + return 0; } -- 1.8.0