mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-05-06 08:18:05 +02:00
mindtct: Check for multiplication overflow in pixelize_map()
Assert if any of the multiplications, which are then used to allocate memory, would overflow. Closes: #96
This commit is contained in:
parent
34b316d7d5
commit
49e1e98914
1 changed files with 3 additions and 0 deletions
|
|
@ -742,6 +742,9 @@ int pixelize_map(int **omap, const int iw, const int ih,
|
|||
int *blkoffs, bw, bh, bi;
|
||||
int *spptr, *pptr;
|
||||
|
||||
ASSERT_SIZE_MUL(iw, ih);
|
||||
ASSERT_SIZE_MUL(iw * ih, sizeof(int));
|
||||
|
||||
pmap = (int *)malloc(iw*ih*sizeof(int));
|
||||
if(pmap == (int *)NULL){
|
||||
fprintf(stderr, "ERROR : pixelize_map : malloc : pmap\n");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue