File: | pygstvalue.c |
Function: | pygst_value_as_pyobject |
Error: | dereferencing NULL (ret->ob_refcnt) at pygstvalue.c:135 |
63 PyObject *
64 pygst_value_as_pyobject (const GValue * value, gboolean copy_boxed)
65 {
66 PyObject *ret = pyg_value_as_pyobject (value, copy_boxed);
when treating unknown struct _PyGObject_Functions * from /usr/include/pygtk-2.0/pygobject.h:207 as non-NULL
when call fails
67 if (!ret) {
taking True path
68 PyErr_Clear ();
69 if (GST_VALUE_HOLDS_FOURCC (value)) {
when treating unknown const struct GValue * from pygstvalue.c:64 as non-NULL
taking False path
when taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
70 gchar str[5];
71 g_snprintf (str, 5, "%" GST_FOURCC_FORMAT,
72 GST_FOURCC_ARGS (gst_value_get_fourcc (value)));
73 ret = PyObject_Call (gstfourcc_class, Py_BuildValue ("(s)", str), NULL);
when Py_BuildValue() succeeds
when treating unknown struct PyObject * from pygstvalue.c:29 as non-NULL
when PyObject_Call() fails
74 } else if (GST_VALUE_HOLDS_INT_RANGE (value)) {
75 ret = PyObject_Call
76 (gstintrange_class,
77 Py_BuildValue ("ii",
78 gst_value_get_int_range_min (value),
79 gst_value_get_int_range_max (value)), NULL);
80 } else if (GST_VALUE_HOLDS_DOUBLE_RANGE (value)) {
81 ret = PyObject_Call
82 (gstdoublerange_class,
83 Py_BuildValue ("dd",
84 gst_value_get_double_range_min (value),
85 gst_value_get_double_range_max (value)), NULL);
86 } else if (GST_VALUE_HOLDS_LIST (value)) {
87 int i, len;
88 len = gst_value_list_get_size (value);
89 ret = PyList_New (len);
90 for (i = 0; i < len; i++) {
91 PyList_SetItem (ret, i,
92 pygst_value_as_pyobject
93 (gst_value_list_get_value (value, i), copy_boxed));
94 }
95 } else if (GST_VALUE_HOLDS_ARRAY (value)) {
96 int i, len;
97 len = gst_value_array_get_size (value);
98 ret = PyTuple_New (len);
99 for (i = 0; i < len; i++) {
100 PyTuple_SetItem (ret, i,
101 pygst_value_as_pyobject
102 (gst_value_array_get_value (value, i), copy_boxed));
103 }
104 } else if (GST_VALUE_HOLDS_FRACTION (value)) {
105 ret = PyObject_Call
106 (gstfraction_class,
107 Py_BuildValue ("ii",
108 gst_value_get_fraction_numerator (value),
109 gst_value_get_fraction_denominator (value)), NULL);
110 } else if (GST_VALUE_HOLDS_FRACTION_RANGE (value)) {
111 const GValue *min, *max;
112 min = gst_value_get_fraction_range_min (value);
113 max = gst_value_get_fraction_range_max (value);
114 ret = PyObject_Call
115 (gstfractionrange_class,
116 Py_BuildValue ("OO",
117 pygst_value_as_pyobject (min, copy_boxed),
118 pygst_value_as_pyobject (max, copy_boxed)), NULL);
119 } else if (GST_VALUE_HOLDS_BUFFER (value)) {
120 return pygstminiobject_new (gst_value_get_mini_object (value));
121 } else {
122 gchar buf[256];
123 g_snprintf (buf, 256, "unknown type: %s",
124 g_type_name (G_VALUE_TYPE (value)));
125 PyErr_SetString (PyExc_TypeError, buf);
126 }
127 }
128
129 if (G_VALUE_TYPE (value) == G_TYPE_STRING) {
when considering value == (GType)64 from pygstvalue.c:129
taking True path
130 PyObject *u = NULL;
131
132 /* FIXME: docs are not clear on whether this sets a python
133 exception when it fails */
134 u = PyUnicode_FromEncodedObject (ret, "utf-8", NULL);
when PyUnicodeUCS4_FromEncodedObject() succeeds
135 Py_DECREF (ret);
dereferencing NULL (ret->ob_refcnt) at pygstvalue.c:135
found 2 similar trace(s) to this
136 ret = u;
137 }
138
139 return ret;
140 }
File: | pygstvalue.c |
Function: | pygst_value_as_pyobject |
Error: | ob_refcnt of new ref from call to Py_BuildValue is 1 too high |
63 PyObject *
64 pygst_value_as_pyobject (const GValue * value, gboolean copy_boxed)
65 {
66 PyObject *ret = pyg_value_as_pyobject (value, copy_boxed);
when treating unknown struct _PyGObject_Functions * from /usr/include/pygtk-2.0/pygobject.h:207 as non-NULL
when call fails
67 if (!ret) {
taking True path
68 PyErr_Clear ();
69 if (GST_VALUE_HOLDS_FOURCC (value)) {
when treating unknown const struct GValue * from pygstvalue.c:64 as non-NULL
taking False path
when taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
70 gchar str[5];
71 g_snprintf (str, 5, "%" GST_FOURCC_FORMAT,
72 GST_FOURCC_ARGS (gst_value_get_fourcc (value)));
73 ret = PyObject_Call (gstfourcc_class, Py_BuildValue ("(s)", str), NULL);
when Py_BuildValue() succeeds
when treating unknown struct PyObject * from pygstvalue.c:29 as non-NULL
when PyObject_Call() fails
new ref from call to Py_BuildValue allocated at: ret = PyObject_Call (gstfourcc_class, Py_BuildValue ("(s)", str), NULL);
ob_refcnt is now refs: 1 + N where N >= 0
74 } else if (GST_VALUE_HOLDS_INT_RANGE (value)) {
75 ret = PyObject_Call
76 (gstintrange_class,
77 Py_BuildValue ("ii",
78 gst_value_get_int_range_min (value),
79 gst_value_get_int_range_max (value)), NULL);
80 } else if (GST_VALUE_HOLDS_DOUBLE_RANGE (value)) {
81 ret = PyObject_Call
82 (gstdoublerange_class,
83 Py_BuildValue ("dd",
84 gst_value_get_double_range_min (value),
85 gst_value_get_double_range_max (value)), NULL);
86 } else if (GST_VALUE_HOLDS_LIST (value)) {
87 int i, len;
88 len = gst_value_list_get_size (value);
89 ret = PyList_New (len);
90 for (i = 0; i < len; i++) {
91 PyList_SetItem (ret, i,
92 pygst_value_as_pyobject
93 (gst_value_list_get_value (value, i), copy_boxed));
94 }
95 } else if (GST_VALUE_HOLDS_ARRAY (value)) {
96 int i, len;
97 len = gst_value_array_get_size (value);
98 ret = PyTuple_New (len);
99 for (i = 0; i < len; i++) {
100 PyTuple_SetItem (ret, i,
101 pygst_value_as_pyobject
102 (gst_value_array_get_value (value, i), copy_boxed));
103 }
104 } else if (GST_VALUE_HOLDS_FRACTION (value)) {
105 ret = PyObject_Call
106 (gstfraction_class,
107 Py_BuildValue ("ii",
108 gst_value_get_fraction_numerator (value),
109 gst_value_get_fraction_denominator (value)), NULL);
110 } else if (GST_VALUE_HOLDS_FRACTION_RANGE (value)) {
111 const GValue *min, *max;
112 min = gst_value_get_fraction_range_min (value);
113 max = gst_value_get_fraction_range_max (value);
114 ret = PyObject_Call
115 (gstfractionrange_class,
116 Py_BuildValue ("OO",
117 pygst_value_as_pyobject (min, copy_boxed),
118 pygst_value_as_pyobject (max, copy_boxed)), NULL);
119 } else if (GST_VALUE_HOLDS_BUFFER (value)) {
120 return pygstminiobject_new (gst_value_get_mini_object (value));
121 } else {
122 gchar buf[256];
123 g_snprintf (buf, 256, "unknown type: %s",
124 g_type_name (G_VALUE_TYPE (value)));
125 PyErr_SetString (PyExc_TypeError, buf);
126 }
127 }
128
129 if (G_VALUE_TYPE (value) == G_TYPE_STRING) {
when considering range: 0 <= value <= 63
taking False path
130 PyObject *u = NULL;
131
132 /* FIXME: docs are not clear on whether this sets a python
133 exception when it fails */
134 u = PyUnicode_FromEncodedObject (ret, "utf-8", NULL);
135 Py_DECREF (ret);
136 ret = u;
137 }
138
139 return ret;
140 }
ob_refcnt of new ref from call to Py_BuildValue is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 14 similar trace(s) to this
File: | pygstvalue.c |
Function: | pygst_value_as_pyobject |
Error: | calling PyObject_Call with NULL as argument 2 (D.36050) at pygstvalue.c:73 |
63 PyObject *
64 pygst_value_as_pyobject (const GValue * value, gboolean copy_boxed)
65 {
66 PyObject *ret = pyg_value_as_pyobject (value, copy_boxed);
when treating unknown struct _PyGObject_Functions * from /usr/include/pygtk-2.0/pygobject.h:207 as non-NULL
when call fails
67 if (!ret) {
taking True path
68 PyErr_Clear ();
69 if (GST_VALUE_HOLDS_FOURCC (value)) {
when treating unknown const struct GValue * from pygstvalue.c:64 as non-NULL
taking False path
when taking True path
taking True path
70 gchar str[5];
71 g_snprintf (str, 5, "%" GST_FOURCC_FORMAT,
72 GST_FOURCC_ARGS (gst_value_get_fourcc (value)));
73 ret = PyObject_Call (gstfourcc_class, Py_BuildValue ("(s)", str), NULL);
when Py_BuildValue() fails
when treating unknown struct PyObject * from pygstvalue.c:29 as non-NULL
calling PyObject_Call with NULL as argument 2 (D.36050) at pygstvalue.c:73
74 } else if (GST_VALUE_HOLDS_INT_RANGE (value)) {
75 ret = PyObject_Call
76 (gstintrange_class,
77 Py_BuildValue ("ii",
78 gst_value_get_int_range_min (value),
79 gst_value_get_int_range_max (value)), NULL);
80 } else if (GST_VALUE_HOLDS_DOUBLE_RANGE (value)) {
81 ret = PyObject_Call
82 (gstdoublerange_class,
83 Py_BuildValue ("dd",
84 gst_value_get_double_range_min (value),
85 gst_value_get_double_range_max (value)), NULL);
86 } else if (GST_VALUE_HOLDS_LIST (value)) {
87 int i, len;
88 len = gst_value_list_get_size (value);
89 ret = PyList_New (len);
90 for (i = 0; i < len; i++) {
91 PyList_SetItem (ret, i,
92 pygst_value_as_pyobject
93 (gst_value_list_get_value (value, i), copy_boxed));
94 }
95 } else if (GST_VALUE_HOLDS_ARRAY (value)) {
96 int i, len;
97 len = gst_value_array_get_size (value);
98 ret = PyTuple_New (len);
99 for (i = 0; i < len; i++) {
100 PyTuple_SetItem (ret, i,
101 pygst_value_as_pyobject
102 (gst_value_array_get_value (value, i), copy_boxed));
103 }
104 } else if (GST_VALUE_HOLDS_FRACTION (value)) {
105 ret = PyObject_Call
106 (gstfraction_class,
107 Py_BuildValue ("ii",
108 gst_value_get_fraction_numerator (value),
109 gst_value_get_fraction_denominator (value)), NULL);
110 } else if (GST_VALUE_HOLDS_FRACTION_RANGE (value)) {
111 const GValue *min, *max;
112 min = gst_value_get_fraction_range_min (value);
113 max = gst_value_get_fraction_range_max (value);
114 ret = PyObject_Call
115 (gstfractionrange_class,
116 Py_BuildValue ("OO",
117 pygst_value_as_pyobject (min, copy_boxed),
118 pygst_value_as_pyobject (max, copy_boxed)), NULL);
119 } else if (GST_VALUE_HOLDS_BUFFER (value)) {
120 return pygstminiobject_new (gst_value_get_mini_object (value));
121 } else {
122 gchar buf[256];
123 g_snprintf (buf, 256, "unknown type: %s",
124 g_type_name (G_VALUE_TYPE (value)));
125 PyErr_SetString (PyExc_TypeError, buf);
126 }
127 }
128
129 if (G_VALUE_TYPE (value) == G_TYPE_STRING) {
130 PyObject *u = NULL;
131
132 /* FIXME: docs are not clear on whether this sets a python
133 exception when it fails */
134 u = PyUnicode_FromEncodedObject (ret, "utf-8", NULL);
135 Py_DECREF (ret);
136 ret = u;
137 }
138
139 return ret;
140 }