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:
parent
551616c3ab
commit
b54514df6e
1 changed files with 2 additions and 0 deletions
|
@ -243,6 +243,8 @@ static void elan_process_frame_linear(unsigned short *raw_frame,
|
||||||
max = raw_frame[i];
|
max = raw_frame[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_assert(max != min);
|
||||||
|
|
||||||
unsigned short px;
|
unsigned short px;
|
||||||
for (int i = 0; i < frame_size; i++) {
|
for (int i = 0; i < frame_size; i++) {
|
||||||
px = raw_frame[i];
|
px = raw_frame[i];
|
||||||
|
|
Loading…
Reference in a new issue