mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
elan: Assert on a possible division by zero in elan_process_frame_linear()
libfprint/drivers/elan.c:249:26: warning: Division by zero
px = (px - min) * 0xff / (max - min);
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
This commit is contained in:
@@ -243,6 +243,8 @@ static void elan_process_frame_linear(unsigned short *raw_frame,
|
||||
max = raw_frame[i];
|
||||
}
|
||||
|
||||
g_assert(max != min);
|
||||
|
||||
unsigned short px;
|
||||
for (int i = 0; i < frame_size; i++) {
|
||||
px = raw_frame[i];
|
||||
|
||||
Reference in New Issue
Block a user