Hopefully solves these security issues from T52924:
I only checked code superficially though, and did not verify because the
repro files do not appear to be publicly available.
It works by adding MEM_malloc_arrayN() and MEM_calloc_arrayN() functions that
return NULL on integer overflow. These functions were only used in some
files around the reported vulnerabilities, not all over Blender, not sure
if we should try to use them everywhere. There is also no realloc, mapalloc
or aligned array function yet.