Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add necessary PyMem_Free and fix PyDict_GetItemRef call #125

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/_imagingft.c
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@
return PyErr_NoMemory();
}

for (int i = 0; i < num_namedstyles; i++) {

Check warning on line 1214 in src/_imagingft.c

View workflow job for this annotation

GitHub Actions / ubuntu-latest Python 3.12

comparison of integer expressions of different signedness: ‘int’ and ‘FT_UInt’ {aka ‘unsigned int’} [-Wsign-compare]
list_names_filled[i] = 0;
}

Expand Down Expand Up @@ -1243,8 +1243,8 @@
}
}

PyMem_Free(list_names_filled);
FT_Done_MM_Var(library, master);

return list_names;
}

Expand Down
4 changes: 2 additions & 2 deletions src/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,8 @@ PyImaging_LibTiffEncoderNew(PyObject *self, PyObject *args) {

if (!is_core_tag) {
PyObject *tag_type;
if (PyDict_GetItemRef(types, key, &tag_type) == 0) {
PyErr_SetString(PyExc_KeyError, "unknown tag type");
if (PyDict_GetItemRef(types, key, &tag_type) < 0) {
return NULL; // Exception has been already set
}
if (tag_type) {
int type_int = PyLong_AsLong(tag_type);
Expand Down
Loading