mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44:31 +03:00
additional potential null returns without error set
This commit is contained in:
parent
87abdf5e6d
commit
0454cb8eb9
|
@ -2260,12 +2260,14 @@ _font_getmask(ImagingFontObject* self, PyObject* args)
|
||||||
|
|
||||||
_font_text_asBytes(encoded_string, &text);
|
_font_text_asBytes(encoded_string, &text);
|
||||||
if (!text) {
|
if (!text) {
|
||||||
|
ImagingError_MemoryError();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
im = ImagingNew(self->bitmap->mode, textwidth(self, text), self->ysize);
|
im = ImagingNew(self->bitmap->mode, textwidth(self, text), self->ysize);
|
||||||
if (!im) {
|
if (!im) {
|
||||||
free(text);
|
free(text);
|
||||||
|
ImagingError_MemoryError();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2297,7 +2299,7 @@ _font_getmask(ImagingFontObject* self, PyObject* args)
|
||||||
failed:
|
failed:
|
||||||
free(text);
|
free(text);
|
||||||
ImagingDelete(im);
|
ImagingDelete(im);
|
||||||
return NULL;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
|
@ -2312,6 +2314,7 @@ _font_getsize(ImagingFontObject* self, PyObject* args)
|
||||||
|
|
||||||
_font_text_asBytes(encoded_string, &text);
|
_font_text_asBytes(encoded_string, &text);
|
||||||
if (!text) {
|
if (!text) {
|
||||||
|
ImagingError_MemoryError();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user