From e4f6682d75b943f959e8f48212ccd348153f495c Mon Sep 17 00:00:00 2001 From: wiredfool Date: Tue, 4 Oct 2016 06:10:28 -0700 Subject: [PATCH] check should be against PY_SSIZE_T_MAX --- map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map.c b/map.c index 3637ee86a..75f463440 100644 --- a/map.c +++ b/map.c @@ -349,7 +349,7 @@ PyImaging_MapBuffer(PyObject* self, PyObject* args) size = (Py_ssize_t) ysize * stride; - if (offset > SIZE_MAX - size) { + if (offset > PY_SSIZE_T_MAX - size) { PyErr_SetString(PyExc_MemoryError, "Integer overflow in offset"); return NULL; }