diff options
author | Emanuele Aina <emanuele.aina@collabora.com> | 2012-03-15 00:00:10 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-03-16 18:48:31 +0800 |
commit | 7b12eea87d880aa47f7fac77c1a0c0c23cd91330 (patch) | |
tree | 2c3848bcff491e43cbbff9eb1521e72e9c2795cd | |
parent | 0ff55aa0c6da02366bad86469d431b2b09963170 (diff) | |
download | gsoc2013-empathy-7b12eea87d880aa47f7fac77c1a0c0c23cd91330.tar gsoc2013-empathy-7b12eea87d880aa47f7fac77c1a0c0c23cd91330.tar.gz gsoc2013-empathy-7b12eea87d880aa47f7fac77c1a0c0c23cd91330.tar.bz2 gsoc2013-empathy-7b12eea87d880aa47f7fac77c1a0c0c23cd91330.tar.lz gsoc2013-empathy-7b12eea87d880aa47f7fac77c1a0c0c23cd91330.tar.xz gsoc2013-empathy-7b12eea87d880aa47f7fac77c1a0c0c23cd91330.tar.zst gsoc2013-empathy-7b12eea87d880aa47f7fac77c1a0c0c23cd91330.zip |
Fix crash on hangup with no video
Insufficient refcount on priv->video_preview_sink caused segfaults
when accessing freed data.
https://bugzilla.gnome.org/show_bug.cgi?id=672063
-rw-r--r-- | src/empathy-call-window.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index 565b9edca..10333d6c3 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -1082,9 +1082,9 @@ create_video_preview (EmpathyCallWindow *self) priv->video_preview_sink = gst_element_factory_make ("cluttersink", NULL); if (priv->video_preview_sink == NULL) - g_error ("Missing cluttersink"); - else - g_object_set (priv->video_preview_sink, "texture", preview, NULL); + g_error ("Missing cluttersink, check your clutter-gst installation"); + g_object_set (priv->video_preview_sink, "texture", preview, NULL); + g_object_add_weak_pointer (G_OBJECT (priv->video_preview_sink), (gpointer) &priv->video_preview_sink); /* Add a little offset to the video preview */ layout = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER, @@ -3626,7 +3626,8 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message, start_call (self); } } - if (GST_MESSAGE_SRC (message) == GST_OBJECT (priv->video_preview_sink)) + if (priv->video_preview_sink != NULL && + GST_MESSAGE_SRC (message) == GST_OBJECT (priv->video_preview_sink)) { gst_message_parse_state_changed (message, NULL, &newstate, &pending); |