mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
nbis: Fix crash in gen_initial_maps()
If the image is too small some coordinates can become negative. Handle this to avoid memory corruption. https://bugs.freedesktop.org/show_bug.cgi?id=57730
This commit is contained in:
committed by
Bastien Nocera
parent
258ac2d4da
commit
a7d6b7c30a
@@ -307,6 +307,10 @@ int gen_initial_maps(int **odmap, int **olcmap, int **olfmap,
|
||||
xmaxlimit = pw - dftgrids->pad - lfsparms->windowsize - 1;
|
||||
ymaxlimit = ph - dftgrids->pad - lfsparms->windowsize - 1;
|
||||
|
||||
/* max limits should not be negative */
|
||||
xmaxlimit = MAX(xmaxlimit, 0);
|
||||
ymaxlimit = MAX(ymaxlimit, 0);
|
||||
|
||||
/* Foreach block in image ... */
|
||||
for(bi = 0; bi < bsize; bi++){
|
||||
/* Adjust block offset from pointing to block origin to pointing */
|
||||
|
||||
Reference in New Issue
Block a user