changeset 32070:4ad7ff6bdc4e

media/backend-fs2: Better fix for the NULL deref crash here. Based on the latest test, GST_ELEMENT_PARENT() is returning NULL at some point. Closes #14033
author Paul Aurich <paul@darkrain42.org>
date Tue, 24 May 2011 01:46:25 +0000
parents 3268f7da72c6
children 3e53f6871805
files libpurple/media/backend-fs2.c
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media/backend-fs2.c	Fri May 20 04:19:13 2011 +0000
+++ b/libpurple/media/backend-fs2.c	Tue May 24 01:46:25 2011 +0000
@@ -1091,13 +1091,7 @@
 	g_error_free(error);
 	g_free(debug_msg);
 
-	/* Not entirely sure this is correct, but prevents a
-	 * NULL deref crash.
-	 */
-	if (!element)
-		return;
-
-	while (!GST_IS_PIPELINE(element)) {
+	while (element && !GST_IS_PIPELINE(element)) {
 		if (element == priv->confbin)
 			break;
 
@@ -1105,7 +1099,7 @@
 		element = GST_ELEMENT_PARENT(element);
 	}
 
-	if (!GST_IS_PIPELINE(element))
+	if (!element || !GST_IS_PIPELINE(element))
 		return;
 
 	sessions = purple_media_get_session_ids(priv->media);