From acd4de381c037274b8b594ca4aa1772601472d5e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ren=C3=A9=20Stadler?= Date: Wed, 29 Aug 2012 10:05:37 -0700 Subject: [PATCH] overrides: Fix crash in add_template templ vs. templates. Moved variable declarations to the inner scope to prevent such a mistake. --- gi/overrides/gstmodule.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gi/overrides/gstmodule.c b/gi/overrides/gstmodule.c index 3060460..e82c02b 100644 --- a/gi/overrides/gstmodule.c +++ b/gi/overrides/gstmodule.c @@ -96,10 +96,9 @@ gi_gst_register_types (PyObject * d) static int add_templates (gpointer gclass, PyObject * templates) { - gint i, len; - PyGObject *templ; - if (PyTuple_Check (templates)) { + gint i, len; + PyGObject *templ; len = PyTuple_Size (templates); if (len == 0) @@ -123,7 +122,7 @@ add_templates (gpointer gclass, PyObject * templates) } - if (GST_IS_PAD_TEMPLATE (pygobject_get (templ)) == FALSE) { + if (GST_IS_PAD_TEMPLATE (pygobject_get (templates)) == FALSE) { PyErr_SetString (PyExc_TypeError, "entry for __gsttemplates__ must be of type GstPadTemplate"); return -1; -- 2.7.4