diff options
-rw-r--r-- | mg2d.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -481,7 +481,7 @@ MG2DContext *mg2d_solver_alloc(size_t domain_size) MG2DInternal *priv; int ret; - if (SIZE_MAX / domain_size < domain_size) + if (domain_size < 3 || SIZE_MAX / domain_size < domain_size) return NULL; ctx = calloc(1, sizeof(*ctx)); |