Commit 768b2ea2 authored by Laurent Aimar's avatar Laurent Aimar
Browse files

* demux: fix segfault while trying to opening files without extention...

parent 0efabac6
......@@ -2,7 +2,7 @@
* m3u.c: a meta demux to parse m3u and asx playlists
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: m3u.c,v 1.11 2003/01/16 21:14:23 babal Exp $
* $Id: m3u.c,v 1.12 2003/01/23 09:00:36 fenrir Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -90,20 +90,23 @@ static int Activate( vlc_object_t * p_this )
/* Check for m3u/asx file extension */
psz_ext = strrchr ( p_input->psz_name, '.' );
if( !strcasecmp( psz_ext, ".m3u") ||
( p_input->psz_demux && !strncmp(p_input->psz_demux, "m3u", 3) ) )
if( psz_ext )
{
i_type = TYPE_M3U;
}
else if( !strcasecmp( psz_ext, ".asx") ||
( p_input->psz_demux && !strncmp(p_input->psz_demux, "asx", 3) ) )
{
i_type = TYPE_ASX;
}
else if( !strcasecmp( psz_ext, ".html") ||
( p_input->psz_demux && !strncmp(p_input->psz_demux, "html", 4) ) )
{
i_type = TYPE_HTML;
if( !strcasecmp( psz_ext, ".m3u") ||
( p_input->psz_demux && !strncmp(p_input->psz_demux, "m3u", 3) ) )
{
i_type = TYPE_M3U;
}
else if( !strcasecmp( psz_ext, ".asx") ||
( p_input->psz_demux && !strncmp(p_input->psz_demux, "asx", 3) ) )
{
i_type = TYPE_ASX;
}
else if( !strcasecmp( psz_ext, ".html") ||
( p_input->psz_demux && !strncmp(p_input->psz_demux, "html", 4) ) )
{
i_type = TYPE_HTML;
}
}
/* we had no luck looking at the file extention, so we have a look
......
......@@ -2,7 +2,7 @@
* rawdv.c : raw dv input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: rawdv.c,v 1.2 2003/01/07 21:49:01 fenrir Exp $
* $Id: rawdv.c,v 1.3 2003/01/23 09:00:36 fenrir Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -137,7 +137,7 @@ static int Activate( vlc_object_t * p_this )
/* Check for dv file extension */
psz_ext = strrchr ( p_input->psz_name, '.' );
if( strcasecmp( psz_ext, ".dv") &&
if( ( !psz_ext || strcasecmp( psz_ext, ".dv") )&&
( !p_input->psz_demux || strcmp(p_input->psz_demux, "rawdv") ) )
{
return -1;
......
......@@ -2,7 +2,7 @@
* sub.c
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: sub.c,v 1.2 2003/01/21 16:46:17 fenrir Exp $
* $Id: sub.c,v 1.3 2003/01/23 09:00:36 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -143,7 +143,7 @@ static int sub_open ( subtitle_demux_t *p_sub,
}
/* *** Open the file *** */
if( !( p_file = fopen( psz_name, "r" ) ) )
if( !( p_file = fopen( psz_name, "rb" ) ) )
{
msg_Err( p_sub, "cannot open `%s' subtitle file", psz_name );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment