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

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

parent 0efabac6
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* m3u.c: a meta demux to parse m3u and asx playlists * m3u.c: a meta demux to parse m3u and asx playlists
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * 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> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -90,6 +90,8 @@ static int Activate( vlc_object_t * p_this ) ...@@ -90,6 +90,8 @@ static int Activate( vlc_object_t * p_this )
/* Check for m3u/asx file extension */ /* Check for m3u/asx file extension */
psz_ext = strrchr ( p_input->psz_name, '.' ); psz_ext = strrchr ( p_input->psz_name, '.' );
if( psz_ext )
{
if( !strcasecmp( psz_ext, ".m3u") || if( !strcasecmp( psz_ext, ".m3u") ||
( p_input->psz_demux && !strncmp(p_input->psz_demux, "m3u", 3) ) ) ( p_input->psz_demux && !strncmp(p_input->psz_demux, "m3u", 3) ) )
{ {
...@@ -105,6 +107,7 @@ static int Activate( vlc_object_t * p_this ) ...@@ -105,6 +107,7 @@ static int Activate( vlc_object_t * p_this )
{ {
i_type = TYPE_HTML; i_type = TYPE_HTML;
} }
}
/* we had no luck looking at the file extention, so we have a look /* we had no luck looking at the file extention, so we have a look
* at the content. This is useful for .asp, .php and similar files * at the content. This is useful for .asp, .php and similar files
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* rawdv.c : raw dv input module for vlc * rawdv.c : raw dv input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * 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> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -137,7 +137,7 @@ static int Activate( vlc_object_t * p_this ) ...@@ -137,7 +137,7 @@ static int Activate( vlc_object_t * p_this )
/* Check for dv file extension */ /* Check for dv file extension */
psz_ext = strrchr ( p_input->psz_name, '.' ); 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") ) ) ( !p_input->psz_demux || strcmp(p_input->psz_demux, "rawdv") ) )
{ {
return -1; return -1;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* sub.c * sub.c
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * 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> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -143,7 +143,7 @@ static int sub_open ( subtitle_demux_t *p_sub, ...@@ -143,7 +143,7 @@ static int sub_open ( subtitle_demux_t *p_sub,
} }
/* *** Open the file *** */ /* *** 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 ); 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