mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +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);
|
||||
if (image == NULL) {
|
||||
PyMem_Del(glyph_info);
|
||||
return NULL;
|
||||
}
|
||||
id = PyLong_AsSsize_t(PyObject_GetAttrString(image, "id"));
|
||||
im = (Imaging)id;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user