[empathy] Fix crash on hangup with no video
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Fix crash on hangup with no video
- Date: Fri, 16 Mar 2012 10:48:41 +0000 (UTC)
commit 7b12eea87d880aa47f7fac77c1a0c0c23cd91330
Author: Emanuele Aina <emanuele aina collabora com>
Date: Wed Mar 14 17:00:10 2012 +0100
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
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 565b9ed..10333d6 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]