From 111d80e5c550b2c505be87e48558b93ac2b42103 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 5 Dec 2018 17:59:14 +0100 Subject: mg2d: enforce a minimum domain size of 3 points --- mg2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mg2d.c b/mg2d.c index c036cf2..eb4efaf 100644 --- a/mg2d.c +++ b/mg2d.c @@ -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)); -- cgit v1.2.3