mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 13:14:27 +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
4b4ed2c9b1
commit
b7f56409eb
|
@ -379,7 +379,7 @@ ImagingNew(const char* mode, int xsize, int ysize)
|
|||
} else
|
||||
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);
|
||||
if (im)
|
||||
return im;
|
||||
|
|
Loading…
Reference in New Issue
Block a user