summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2016-07-11 18:29:01 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2016-07-11 19:17:49 -0400
commitf0678d73b1f379816cf8ea7fb25807ea49768997 (patch)
tree2b306110360f2f7d9287eb94e909f9833dba7d1f /sys
parente62bd2f7d8a43f9924c2f89ed4230e9389c7f0e6 (diff)
v4l2object: Don't assert when used by the monitor
The monitor sets the object->element object as a GstObject. This works for debug traces, but will assert for ELEMENT_ERROR. This was the only case where that could happen. Add a check for that.
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2object.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 8dfaa305a..e7637d2f4 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -1159,12 +1159,17 @@ gst_v4l2_object_fill_format_list (GstV4l2Object * v4l2object,
/* ERRORS */
failed:
{
+ g_free (format);
+
+ if (!GST_IS_ELEMENT (v4l2object->element))
+ return FALSE;
+
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
(_("Failed to enumerate possible video formats device '%s' can work "
"with"), v4l2object->videodev),
("Failed to get number %d in pixelformat enumeration for %s. (%d - %s)",
n, v4l2object->videodev, errno, g_strerror (errno)));
- g_free (format);
+
return FALSE;
}
}