Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2:Test
python-imaging
Imaging-1.1.6-ssize.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Imaging-1.1.6-ssize.patch of Package python-imaging
--- _imaging.c +++ _imaging.c @@ -316,6 +316,7 @@ getlist(PyObject* arg, int* length, const char* wrong_length, int type) { int i, n; + Py_ssize_t s; void* list; if (!PySequence_Check(arg)) { @@ -323,7 +324,8 @@ return NULL; } - n = PyObject_Length(arg); + s = PyObject_Length(arg); + n = (s > INT_MAX) ? INT_MAX : s; if (length && wrong_length && n != *length) { PyErr_SetString(PyExc_ValueError, wrong_length); return NULL; @@ -1125,6 +1127,7 @@ { Imaging image; int n, i, x, y; + Py_ssize_t s; PyObject* data; double scale = 1.0; @@ -1139,7 +1142,8 @@ image = self->image; - n = PyObject_Length(data); + s = PyObject_Length(data); + n = (s > INT_MAX) ? INT_MAX : s; if (n > (int) (image->xsize * image->ysize)) { PyErr_SetString(PyExc_TypeError, "too many data entries"); return NULL; @@ -2880,7 +2884,7 @@ /* basic sequence semantics */ -static int +static Py_ssize_t image_length(ImagingObject *self) { Imaging im = self->image; @@ -2889,7 +2893,7 @@ } static PyObject * -image_item(ImagingObject *self, int i) +image_item(ImagingObject *self, Py_ssize_t i) { int x, y; Imaging im = self->image; @@ -2904,7 +2908,7 @@ } static PySequenceMethods image_as_sequence = { - (inquiry)image_length, /*sq_length*/ + (lenfunc)image_length, /*sq_length*/ (binaryfunc)0, /*sq_concat*/ (ssizeargfunc)0, /*sq_repeat*/ (ssizeargfunc)image_item, /*sq_item*/ --- path.c +++ path.c @@ -111,6 +111,7 @@ PyPath_Flatten(PyObject* data, double **pxy) { int i, j, n; + Py_ssize_t s; double *xy; PyBufferProcs *buffer; @@ -147,7 +148,8 @@ } j = 0; - n = PyObject_Length(data); + s = PyObject_Length(data); + n = (s > INT_MAX) ? INT_MAX : s; /* Just in case __len__ breaks (or doesn't exist) */ if (PyErr_Occurred()) return -1; @@ -357,7 +359,7 @@ } static PyObject* -path_getitem(PyPathObject* self, int i) +path_getitem(PyPathObject* self, Py_ssize_t i) { if (i < 0 || i >= self->count) { PyErr_SetString(PyExc_IndexError, "path index out of range"); @@ -368,7 +370,7 @@ } static PyObject* -path_getslice(PyPathObject* self, int ilow, int ihigh) +path_getslice(PyPathObject* self, Py_ssize_t ilow, Py_ssize_t ihigh) { /* adjust arguments */ if (ilow < 0) @@ -385,7 +387,7 @@ return (PyObject*) path_new(ihigh - ilow, self->xy + ilow * 2, 1); } -static int +static Py_ssize_t path_len(PyPathObject* self) { return self->count; @@ -423,7 +425,7 @@ } static int -path_setitem(PyPathObject* self, int i, PyObject* op) +path_setitem(PyPathObject* self, Py_ssize_t i, PyObject* op) { double* xy; @@ -556,7 +558,7 @@ } static PySequenceMethods path_as_sequence = { - (inquiry)path_len, /*sq_length*/ + (lenfunc)path_len, /*sq_length*/ (binaryfunc)0, /*sq_concat*/ (ssizeargfunc)0, /*sq_repeat*/ (ssizeargfunc)path_getitem, /*sq_item*/
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor