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)];