Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2451840

Browse files
committed
Use default value for invalid key instead of NULL
1 parent ca4f048 commit 2451840

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_png.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ static PyObject *Py_write_png(PyObject *self, PyObject *args, PyObject *kwds)
318318
} else if (PyBytes_Check(meta_key)) {
319319
text[meta_pos].key = PyBytes_AsString(meta_key);
320320
} else {
321-
text[meta_pos].key = NULL; // Silently drops entry
321+
text[meta_pos].key = (char *)"INVALID KEY";
322322
}
323323
if (PyUnicode_Check(meta_val)) {
324324
PyObject *temp_val = PyUnicode_AsEncodedString(meta_val, "latin_1", "strict");

0 commit comments

Comments
 (0)