mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Return early if image is null
This commit is contained in:
parent
594fbf79b8
commit
618c00c4ea
|
@ -887,6 +887,10 @@ font_render(FontObject *self, PyObject *args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
image = PyObject_CallFunction(fill, "s(ii)", strcmp(mode, "RGBA") == 0 ? "RGBA" : "L", width, height);
|
image = PyObject_CallFunction(fill, "s(ii)", strcmp(mode, "RGBA") == 0 ? "RGBA" : "L", width, height);
|
||||||
|
if (image == NULL) {
|
||||||
|
PyMem_Del(glyph_info);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
id = PyLong_AsSsize_t(PyObject_GetAttrString(image, "id"));
|
id = PyLong_AsSsize_t(PyObject_GetAttrString(image, "id"));
|
||||||
im = (Imaging)id;
|
im = (Imaging)id;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user