mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-29 17:33:08 +03:00
int->Py_ssize_t, fixes #436
This commit is contained in:
parent
404b245d89
commit
954d1ae435
8
map.c
8
map.c
|
@ -323,7 +323,7 @@ mapping_destroy_buffer(Imaging im)
|
||||||
PyObject*
|
PyObject*
|
||||||
PyImaging_MapBuffer(PyObject* self, PyObject* args)
|
PyImaging_MapBuffer(PyObject* self, PyObject* args)
|
||||||
{
|
{
|
||||||
int y, size;
|
Py_ssize_t y, size;
|
||||||
Imaging im;
|
Imaging im;
|
||||||
|
|
||||||
PyObject* target;
|
PyObject* target;
|
||||||
|
@ -331,12 +331,12 @@ PyImaging_MapBuffer(PyObject* self, PyObject* args)
|
||||||
char* mode;
|
char* mode;
|
||||||
char* codec;
|
char* codec;
|
||||||
PyObject* bbox;
|
PyObject* bbox;
|
||||||
int offset;
|
Py_ssize_t offset;
|
||||||
int xsize, ysize;
|
int xsize, ysize;
|
||||||
int stride;
|
int stride;
|
||||||
int ystep;
|
int ystep;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "O(ii)sOi(sii)", &target, &xsize, &ysize,
|
if (!PyArg_ParseTuple(args, "O(ii)sOn(sii)", &target, &xsize, &ysize,
|
||||||
&codec, &bbox, &offset, &mode, &stride, &ystep))
|
&codec, &bbox, &offset, &mode, &stride, &ystep))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ PyImaging_MapBuffer(PyObject* self, PyObject* args)
|
||||||
stride = xsize * 4;
|
stride = xsize * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = ysize * stride;
|
size = (Py_ssize_t) ysize * stride;
|
||||||
|
|
||||||
/* check buffer size */
|
/* check buffer size */
|
||||||
if (PyImaging_GetBuffer(target, &view) < 0)
|
if (PyImaging_GetBuffer(target, &view) < 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user