Commit a1e69a0e authored by Bastien Nocera's avatar Bastien Nocera

mindtct: Check for multiplication overflow in morph_TF_map()

Assert if any of the multiplications, which are then used to allocate
memory and run a loop, would overflow.

Closes: #92
parent 49e1e989
......@@ -677,6 +677,7 @@ int morph_TF_map(int *tfmap, const int mw, const int mh,
int *mptr;
int i;
ASSERT_INT_MUL(mw, mh);
/* Convert TRUE/FALSE map into a binary byte image. */
cimage = (unsigned char *)malloc(mw*mh);
......
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