mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
mindtct: Check for multiplication overflow in interpolate_direction_map()
Assert if any of the multiplications, which are then used to allocate memory, would overflow. Closes: #100
This commit is contained in:
@@ -502,6 +502,8 @@ int interpolate_direction_map(int *direction_map, int *low_contrast_map,
|
||||
print2log("INTERPOLATE DIRECTION MAP\n");
|
||||
|
||||
/* Allocate output (interpolated) Direction Map. */
|
||||
ASSERT_SIZE_MUL(mw, mh);
|
||||
ASSERT_SIZE_MUL(mw * mh, sizeof(int));
|
||||
omap = (int *)malloc(mw*mh*sizeof(int));
|
||||
if(omap == (int *)NULL){
|
||||
fprintf(stderr,
|
||||
|
||||
Reference in New Issue
Block a user