pidgin: e406ff22: media/backend-fs2: Better fix for the NU..

darkrain42 at pidgin.im darkrain42 at pidgin.im
Mon May 23 21:50:42 EDT 2011


----------------------------------------------------------------------
Revision: e406ff22b49f15b4ba4888f05f0e019b38575ea2
Parent:   c5ff15b5ec091a257bfe57b1a21de743d77bd723
Author:   darkrain42 at pidgin.im
Date:     05/23/11 21:46:25
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e406ff22b49f15b4ba4888f05f0e019b38575ea2

Changelog: 

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

Changes against parent c5ff15b5ec091a257bfe57b1a21de743d77bd723

  patched  libpurple/media/backend-fs2.c

-------------- next part --------------
============================================================
--- libpurple/media/backend-fs2.c	571f978c7bcef42225c6f74c221559d9a076c78e
+++ libpurple/media/backend-fs2.c	bcf363e92e4d95d1c948cf4f1738758d649073c9
@@ -1091,13 +1091,7 @@ gst_handle_message_error(GstBus *bus, Gs
 	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 @@ gst_handle_message_error(GstBus *bus, Gs
 		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);


More information about the Commits mailing list