mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-16 11:30:49 +03:00
Multiplication needs to be 64bit, to handle overflow regardless of the bittedness of the machine, fixes #771#
This commit is contained in:
parent
80d6137c86
commit
d06072ff46
|
@ -379,7 +379,7 @@ ImagingNew(const char* mode, int xsize, int ysize)
|
||||||
} else
|
} else
|
||||||
bytes = strlen(mode); /* close enough */
|
bytes = strlen(mode); /* close enough */
|
||||||
|
|
||||||
if ((Py_ssize_t) xsize * ysize * bytes <= THRESHOLD) {
|
if ((int64_t) xsize * (int64_t) ysize * bytes <= THRESHOLD) {
|
||||||
im = ImagingNewBlock(mode, xsize, ysize);
|
im = ImagingNewBlock(mode, xsize, ysize);
|
||||||
if (im)
|
if (im)
|
||||||
return im;
|
return im;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user