From 7080a5ff8b07d278ad6fbbf63388e1785763ae38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= Date: Fri, 9 Dec 2022 15:47:44 +0100 Subject: [PATCH] Abort initialization if unknown sensor dimensions are reported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zoltán Böszörményi --- libfprint/drivers/upektc_img.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libfprint/drivers/upektc_img.c b/libfprint/drivers/upektc_img.c index 8898c5c2..f2c6edb8 100644 --- a/libfprint/drivers/upektc_img.c +++ b/libfprint/drivers/upektc_img.c @@ -602,10 +602,15 @@ init_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device, default: fp_dbg ("Sensor type : Unknown"); - break; + + fpi_ssm_mark_failed (transfer->ssm, + fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, + "Unknown sensor type (reported size %dx%d)", + width, height)); + + return; } - BUG_ON (img_class->img_width == -1 || img_class->img_height == -1); self->expected_image_size = img_class->img_width * img_class->img_height; self->image_bits = g_malloc0 (self->expected_image_size * 2); }