Commit b54514df authored by Bastien Nocera's avatar Bastien Nocera

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);
                     ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
parent 551616c3
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment