mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 18:36:17 +03:00
fix for #2783, Return none without error set
This commit is contained in:
parent
5e159c2ff4
commit
87abdf5e6d
17
_imaging.c
17
_imaging.c
|
@ -2212,16 +2212,15 @@ void _font_text_asBytes(PyObject* encoded_string, unsigned char** text){
|
|||
PyBytes_AsStringAndSize(encoded_string, &buffer, &len);
|
||||
}
|
||||
|
||||
if (len) {
|
||||
*text = calloc(len,1);
|
||||
if (*text) {
|
||||
memcpy(*text, buffer, len);
|
||||
}
|
||||
if(bytes) {
|
||||
Py_DECREF(bytes);
|
||||
}
|
||||
return;
|
||||
*text = calloc(len,1);
|
||||
if (*text) {
|
||||
memcpy(*text, buffer, len);
|
||||
}
|
||||
if(bytes) {
|
||||
Py_DECREF(bytes);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
|
||||
#if PY_VERSION_HEX < 0x03000000
|
||||
|
|
Loading…
Reference in New Issue
Block a user