mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-10 21:06:51 +00:00
vfs101: Prevent a division by zero
This commit is contained in:
committed by
Marco Trevisan
parent
62c8554dac
commit
ba6f87584a
@@ -708,6 +708,9 @@ vfs_check_contrast (FpDeviceVfs101 *vdev)
|
|||||||
int y;
|
int y;
|
||||||
long int count = 0;
|
long int count = 0;
|
||||||
|
|
||||||
|
if (vdev->height <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Check difference from byte 4 to byte 5 for verify contrast of image */
|
/* Check difference from byte 4 to byte 5 for verify contrast of image */
|
||||||
for (y = 0; y < vdev->height; y++)
|
for (y = 0; y < vdev->height; y++)
|
||||||
count = count + vdev->buffer[offset (5, y)] - vdev->buffer[offset (4, y)];
|
count = count + vdev->buffer[offset (5, y)] - vdev->buffer[offset (4, y)];
|
||||||
|
|||||||
Reference in New Issue
Block a user