diff options
author | Vasily Khoruzhick <anarsoul@gmail.com> | 2012-11-18 11:30:34 +0300 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2012-11-29 09:59:27 +0100 |
commit | bc497f1b263d6d0e7efafba1568a79b644ecc875 (patch) | |
tree | 10eb141b609e6d2f5683393a8afab979f9692511 /libfprint | |
parent | 8c5f2e6434275603da6a5eb21468a43497692575 (diff) |
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
Diffstat (limited to 'libfprint')
-rw-r--r-- | libfprint/aeslib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libfprint/aeslib.c b/libfprint/aeslib.c index 0b01d31..00ddfd9 100644 --- a/libfprint/aeslib.c +++ b/libfprint/aeslib.c @@ -165,8 +165,8 @@ void aes_assemble_image(unsigned char *input, size_t width, size_t height, for (column = 0; column < width; column++) { for (row = 0; row < height; row += 2) { - output[width * row + column] = (*input & 0x07) * 36; - output[width * (row + 1) + column] = ((*input & 0x70) >> 4) * 36; + output[width * row + column] = (*input & 0x0f) * 17; + output[width * (row + 1) + column] = ((*input & 0xf0) >> 4) * 17; input++; } } |