mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
aeslib: prevent integer overflow
AuthenTec devices send 4bpp images, but current code assumes 3bpp for some reason. https://bugs.freedesktop.org/show_bug.cgi?id=57426
This commit is contained in:
committed by
Bastien Nocera
parent
8c5f2e6434
commit
bc497f1b26
@@ -165,8 +165,8 @@ void aes_assemble_image(unsigned char *input, size_t width, size_t height,
|
|||||||
|
|
||||||
for (column = 0; column < width; column++) {
|
for (column = 0; column < width; column++) {
|
||||||
for (row = 0; row < height; row += 2) {
|
for (row = 0; row < height; row += 2) {
|
||||||
output[width * row + column] = (*input & 0x07) * 36;
|
output[width * row + column] = (*input & 0x0f) * 17;
|
||||||
output[width * (row + 1) + column] = ((*input & 0x70) >> 4) * 36;
|
output[width * (row + 1) + column] = ((*input & 0xf0) >> 4) * 17;
|
||||||
input++;
|
input++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user