Skip to content

Commit b5f7c19

Browse files
authored
Check WebPMuxNew return value (#9689)
1 parent 95e9d4a commit b5f7c19

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/_webp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,10 @@ WebPEncode_wrapper(PyObject *self, PyObject *args) {
691691
// and value 0 indicates data will NOT be copied.
692692

693693
WebPMux *mux = WebPMuxNew();
694+
if (mux == NULL) {
695+
PyErr_SetString(PyExc_RuntimeError, "could not create mux object");
696+
return NULL;
697+
}
694698
WebPMuxSetImage(mux, &image, copy_data);
695699

696700
if (dbg) {

0 commit comments

Comments
 (0)