diff --git a/map.c b/map.c index 3637ee86a0a..75f46344011 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; }