vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Mon Dec 6 06:04:35 2010 +0200| [ad4cf3034b2e1cb7eb5245585e16dc842f1e54c0] | committer: Rémi Denis-Courmont
IFO: fix DVD-VR as well > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ad4cf3034b2e1cb7eb5245585e16dc842f1e54c0 --- modules/demux/playlist/ifo.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/demux/playlist/ifo.c b/modules/demux/playlist/ifo.c index 0f48e15..4dbdb73 100644 --- a/modules/demux/playlist/ifo.c +++ b/modules/demux/playlist/ifo.c @@ -30,6 +30,7 @@ #include <vlc_common.h> #include <vlc_demux.h> +#include <assert.h> #include "playlist.h" @@ -120,14 +121,15 @@ static int Demux( demux_t *p_demux ) static int DemuxDVD_VR( demux_t *p_demux ) { - char *psz_url = strdup( p_demux->psz_file ); + size_t len = strlen( p_demux->psz_location ); + char *psz_url = malloc( len + 1 ); - if( !psz_url ) + if( unlikely( psz_url == NULL ) ) return 0; - - size_t len = strlen( psz_url ); - - strncpy( psz_url + len - 12, "VR_MOVIE.VRO", 12 ); + assert( len >= 12 ); + len -= 12; + memcpy( psz_url, p_demux->psz_location, len ); + memcpy( psz_url + len, "VR_MOVIE.VRO", 13 ); input_item_t *p_current_input = GetCurrentItem(p_demux); input_item_t *p_input = input_item_New( p_demux, psz_url, psz_url ); _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
