vfs101: Prevent a division by zero

This commit is contained in:
Marco Trevisan (Treviño)
2026-07-13 08:13:46 +00:00
committed by Marco Trevisan
parent 62c8554dac
commit ba6f87584a
+3
View File
@@ -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)];