# HG changeset patch # User Paul Aurich # Date 1305163310 0 # Node ID 0b73619ad5814a65fa8e144ae1d97046a1384f24 # Parent bfb4b66953b4330f3d44b8b0af63a305a3872d6d media: Fix a NULL pointer deref crash, and add diagnostic logging. I'm not entirely sure that just short-circuiting error handling in this case is correct (in fact I suspect it's not), but it's certainly better than a crash, and now there's detail on the actual error. Closes #14033 diff -r bfb4b66953b4 -r 0b73619ad581 libpurple/media/backend-fs2.c --- a/libpurple/media/backend-fs2.c Wed May 11 09:29:47 2011 +0000 +++ b/libpurple/media/backend-fs2.c Thu May 12 01:21:50 2011 +0000 @@ -1081,6 +1081,22 @@ GstElement *lastElement = NULL; GList *sessions; + GError *error = NULL; + gchar *debug_msg = NULL; + + gst_message_parse_error(msg, &error, &debug_msg); + purple_debug_error("backend-fs2", "gst error %s\ndebugging: %s\n", + error->message, debug_msg); + + 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)) { if (element == priv->confbin) break;