mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 08:14:10 +03:00
encode: Replace PyDict_GetItem with PyDict_GetItemRef
This commit is contained in:
parent
377bdc0db1
commit
7c64ae0c73
|
@ -722,7 +722,10 @@ PyImaging_LibTiffEncoderNew(PyObject *self, PyObject *args) {
|
|||
}
|
||||
|
||||
if (!is_core_tag) {
|
||||
PyObject *tag_type = PyDict_GetItem(types, key);
|
||||
PyObject *tag_type;
|
||||
if (PyDict_GetItemRef(types, key, &tag_type) == 0) {
|
||||
PyErr_SetString(PyExc_KeyError, "unknown tag type");
|
||||
}
|
||||
if (tag_type) {
|
||||
int type_int = PyLong_AsLong(tag_type);
|
||||
if (type_int >= TIFF_BYTE && type_int <= TIFF_DOUBLE) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user