Corrected allocation

This commit is contained in:
Andrew Murray 2022-01-14 10:16:35 +11:00
parent fd2b07c454
commit fe32501922

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