Commit 49e1e989 authored by Bastien Nocera's avatar Bastien Nocera

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
parent 34b316d7
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment