From ba6f87584adeffa29742bdfe5b473d338cf84e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 30 Jun 2026 19:39:09 +0200 Subject: [PATCH] vfs101: Prevent a division by zero --- libfprint/drivers/vfs101.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libfprint/drivers/vfs101.c b/libfprint/drivers/vfs101.c index e7667c87..ca77901a 100644 --- a/libfprint/drivers/vfs101.c +++ b/libfprint/drivers/vfs101.c @@ -708,6 +708,9 @@ vfs_check_contrast (FpDeviceVfs101 *vdev) int y; long int count = 0; + if (vdev->height <= 0) + return; + /* Check difference from byte 4 to byte 5 for verify contrast of image */ for (y = 0; y < vdev->height; y++) count = count + vdev->buffer[offset (5, y)] - vdev->buffer[offset (4, y)];