diff --git a/src/path.c b/src/path.c index e2bdc9419ea..3e3431575ec 100644 --- a/src/path.c +++ b/src/path.c @@ -57,7 +57,7 @@ alloc_array(Py_ssize_t count) { if ((unsigned long long)count > (SIZE_MAX / (2 * sizeof(double))) - 1) { return ImagingError_MemoryError(); } - xy = calloc(2 * count * sizeof(double) + 1, sizeof(double)); + xy = calloc(2 * count + 1, sizeof(double)); if (!xy) { ImagingError_MemoryError(); }