Merge pull request #5958 from radarhere/memory

This commit is contained in:
Hugo van Kemenade 2022-03-27 18:49:07 +03:00 committed by GitHub
commit 5a35e87e65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}