mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 21:24:31 +03:00
int->py_ssize_t for potentially large numbers
This commit is contained in:
parent
631612edc6
commit
1060a59de9
|
@ -325,15 +325,15 @@ Imaging
|
|||
ImagingNewBlock(const char *mode, int xsize, int ysize)
|
||||
{
|
||||
Imaging im;
|
||||
int y, i;
|
||||
int bytes;
|
||||
Py_ssize_t y, i;
|
||||
Py_ssize_t bytes;
|
||||
|
||||
im = ImagingNewPrologue(mode, xsize, ysize);
|
||||
if (!im)
|
||||
return NULL;
|
||||
|
||||
/* Use a single block */
|
||||
bytes = im->ysize * im->linesize;
|
||||
bytes = (Py_ssize_t) im->ysize * im->linesize;
|
||||
if (bytes <= 0)
|
||||
/* some platforms return NULL for malloc(0); this fix
|
||||
prevents MemoryError on zero-sized images on such
|
||||
|
|
Loading…
Reference in New Issue
Block a user