totem r5346 - in trunk: . src/backend



Author: hadess
Date: Tue Apr  8 14:20:17 2008
New Revision: 5346
URL: http://svn.gnome.org/viewvc/totem?rev=5346&view=rev

Log:
2008-04-08  Bastien Nocera  <hadess hadess net>

	* src/backend/bacon-video-widget-xine.c
	(bacon_video_widget_strdupnv), (bacon_video_widget_get_mrls):
	xine-lib doesn't NULL terminate its string arrays, so do without
	(Closes: #526497)



Modified:
   trunk/ChangeLog
   trunk/src/backend/bacon-video-widget-xine.c

Modified: trunk/src/backend/bacon-video-widget-xine.c
==============================================================================
--- trunk/src/backend/bacon-video-widget-xine.c	(original)
+++ trunk/src/backend/bacon-video-widget-xine.c	Tue Apr  8 14:20:17 2008
@@ -3515,6 +3515,20 @@
 	return BVW_CAN_PLAY_MISSING_PLUGINS;
 }
 
+static char *
+bacon_video_widget_strdupnv (const char **mrls, int num_mrls)
+{
+	guint i;
+	char **retval;
+
+	retval = g_new (gchar*, num_mrls + 1);
+	for (i = 0; i < num_mrls; i++)
+		retval[i] = g_strdup (mrls[i]);
+	retval[num_mrls] = NULL;
+
+	return retval;
+}
+
 char **
 bacon_video_widget_get_mrls (BaconVideoWidget *bvw,
 			     TotemDiscMediaType type,
@@ -3570,10 +3584,10 @@
 			return NULL;
 		/* The first channel can be the last channel played,
 		 * or a copy of the first one, ignore it */
-		return g_strdupv (mrls++);
+		return bacon_video_widget_strdupnv (mrls++, num_mrls - 1);
 	}
 
-	return g_strdupv (mrls);
+	return bacon_video_widget_strdupnv (mrls, num_mrls);
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]