From c3dab3df761a7ae0680753b4993cefcff56a0482 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Wed, 28 Sep 2011 15:16:07 +0200 Subject: [PATCH] pad: fix Py_DECREF of null pointer in pad probe and pad block marshallers https://bugzilla.gnome.org/show_bug.cgi?id=660357 --- gst/gstpad.override | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gst/gstpad.override b/gst/gstpad.override index 2f701dd53a..f8a65a4d2c 100644 --- a/gst/gstpad.override +++ b/gst/gstpad.override @@ -899,6 +899,11 @@ data_probe_callback_marshal(GstPad *pad, GstMiniObject *obj, gpointer user_data) Py_DECREF (tmp); } + if (args == NULL) { + ret = NULL; + goto beach; + } + pret = PyObject_CallObject(callback, args); Py_DECREF(args); @@ -909,9 +914,9 @@ data_probe_callback_marshal(GstPad *pad, GstMiniObject *obj, gpointer user_data) ret = PyObject_IsTrue(pret)? TRUE : FALSE; Py_DECREF(pret); } - - pyg_gil_state_release(state); +beach: + pyg_gil_state_release(state); return ret; } @@ -1396,14 +1401,17 @@ pad_block_callback_marshal(GstPad *pad, gboolean blocked, gpointer user_data) Py_DECREF (tmp); } + if (args != NULL) + goto beach; + ret = PyObject_CallObject(callback, args); - Py_DECREF(args); if (!ret) PyErr_Print(); else Py_DECREF(ret); - + +beach: pyg_gil_state_release(state); }