comparison libpurple/media/backend-fs2.c @ 32053:0b73619ad581

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
author Paul Aurich <paul@darkrain42.org>
date Thu, 12 May 2011 01:21:50 +0000
parents a4ba3b194ce3
children 4ad7ff6bdc4e
comparison
equal deleted inserted replaced
32052:bfb4b66953b4 32053:0b73619ad581
1078 PurpleMediaBackendFs2Private *priv = 1078 PurpleMediaBackendFs2Private *priv =
1079 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); 1079 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self);
1080 GstElement *element = GST_ELEMENT(GST_MESSAGE_SRC(msg)); 1080 GstElement *element = GST_ELEMENT(GST_MESSAGE_SRC(msg));
1081 GstElement *lastElement = NULL; 1081 GstElement *lastElement = NULL;
1082 GList *sessions; 1082 GList *sessions;
1083
1084 GError *error = NULL;
1085 gchar *debug_msg = NULL;
1086
1087 gst_message_parse_error(msg, &error, &debug_msg);
1088 purple_debug_error("backend-fs2", "gst error %s\ndebugging: %s\n",
1089 error->message, debug_msg);
1090
1091 g_error_free(error);
1092 g_free(debug_msg);
1093
1094 /* Not entirely sure this is correct, but prevents a
1095 * NULL deref crash.
1096 */
1097 if (!element)
1098 return;
1083 1099
1084 while (!GST_IS_PIPELINE(element)) { 1100 while (!GST_IS_PIPELINE(element)) {
1085 if (element == priv->confbin) 1101 if (element == priv->confbin)
1086 break; 1102 break;
1087 1103