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:
Bastien Nocera 2018-12-12 16:24:05 +01:00
parent 551616c3ab
commit b54514df6e

View file

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