mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-27 16:36:39 +00:00
overrides: Fix crash in add_template
templ vs. templates. Moved variable declarations to the inner scope to prevent such a mistake.
This commit is contained in:
parent
bfcf304857
commit
acd4de381c
1 changed files with 3 additions and 4 deletions
|
@ -96,11 +96,10 @@ gi_gst_register_types (PyObject * d)
|
||||||
static int
|
static int
|
||||||
add_templates (gpointer gclass, PyObject * templates)
|
add_templates (gpointer gclass, PyObject * templates)
|
||||||
{
|
{
|
||||||
|
if (PyTuple_Check (templates)) {
|
||||||
gint i, len;
|
gint i, len;
|
||||||
PyGObject *templ;
|
PyGObject *templ;
|
||||||
|
|
||||||
if (PyTuple_Check (templates)) {
|
|
||||||
|
|
||||||
len = PyTuple_Size (templates);
|
len = PyTuple_Size (templates);
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
return 0;
|
return 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,
|
PyErr_SetString (PyExc_TypeError,
|
||||||
"entry for __gsttemplates__ must be of type GstPadTemplate");
|
"entry for __gsttemplates__ must be of type GstPadTemplate");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue