Multiplication needs to be 64bit, to handle overflow regardless of the bittedness of the machine, fixes #771#

This commit is contained in:
wiredfool 2014-07-05 14:30:34 -07:00
parent 4b4ed2c9b1
commit b7f56409eb

View File

@ -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;