[longomatch] Fix segfault when no devices are presents
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix segfault when no devices are presents
- Date: Wed, 24 Sep 2014 20:23:01 +0000 (UTC)
commit fe07b0998b361da4e1e72a5c44cbecafa3214a39
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Sep 4 17:32:18 2014 +0200
Fix segfault when no devices are presents
libcesarplayer/gst-camera-capturer.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libcesarplayer/gst-camera-capturer.c b/libcesarplayer/gst-camera-capturer.c
index 9616413..99e8653 100644
--- a/libcesarplayer/gst-camera-capturer.c
+++ b/libcesarplayer/gst-camera-capturer.c
@@ -1370,8 +1370,10 @@ gst_camera_capturer_enum_devices (const gchar * device_name)
finish:
{
- gst_element_set_state (device, GST_STATE_NULL);
- gst_object_unref (GST_OBJECT (device));
+ if (device != NULL) {
+ gst_element_set_state (device, GST_STATE_NULL);
+ gst_object_unref (GST_OBJECT (device));
+ }
return list;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]