Changeset 4ff2a9a24fc18d489e6b3c1203470ba5874df25b

Show
Ignore:
Timestamp:
03/09/05 17:55:52 (3 years ago)
Author:
Steve Lhomme <robux@videolan.org>
git-committer:
Steve Lhomme <robux@videolan.org> 1125762952 +0000
git-parent:

[cb2ad9ec570fec13ea17a46a43518d8ef4ef84c1]

git-author:
Steve Lhomme <robux@videolan.org> 1125762952 +0000
Message:

* prevent crashes when a stream is not opened correctly

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_stream.h

    r39cc95b r4ff2a9a  
    123123    va_list args; 
    124124    int     i_result; 
     125 
     126    if ( s == NULL ) 
     127        return VLC_EGENERIC; 
    125128 
    126129    va_start( args, i_query ); 
  • modules/demux/mkv.cpp

    r8fd5f21 r4ff2a9a  
    14821482                    { 
    14831483                        // test wether this file belongs to our family 
    1484                         vlc_stream_io_callback *p_file_io = new vlc_stream_io_callback( stream_UrlNew( p_demux, s_filename.c_str()), VLC_TRUE ); 
    1485                         EbmlStream *p_estream = new EbmlStream(*p_file_io); 
    1486  
    1487                         p_stream = p_sys->AnalyseAllSegmentsFound( p_estream ); 
    1488                         if ( p_stream == NULL ) 
     1484                        stream_t *p_file_stream = stream_UrlNew( p_demux, s_filename.c_str()); 
     1485                        if ( p_file_stream != NULL ) 
    14891486                        { 
    1490                             msg_Dbg( p_demux, "the file '%s' will not be used", s_filename.c_str() ); 
    1491                             delete p_estream; 
    1492                             delete p_file_io; 
     1487                            vlc_stream_io_callback *p_file_io = new vlc_stream_io_callback( p_file_stream, VLC_TRUE ); 
     1488                            EbmlStream *p_estream = new EbmlStream(*p_file_io); 
     1489 
     1490                            p_stream = p_sys->AnalyseAllSegmentsFound( p_estream ); 
     1491 
     1492                            if ( p_stream == NULL ) 
     1493                            { 
     1494                                msg_Dbg( p_demux, "the file '%s' will not be used", s_filename.c_str() ); 
     1495                                delete p_estream; 
     1496                                delete p_file_io; 
     1497                            } 
     1498                            else 
     1499                            { 
     1500                                p_stream->p_in = p_file_io; 
     1501                                p_stream->p_es = p_estream; 
     1502                                p_sys->streams.push_back( p_stream ); 
     1503                            } 
    14931504                        } 
    14941505                        else 
    14951506                        { 
    1496                             p_stream->p_in = p_file_io; 
    1497                             p_stream->p_es = p_estream; 
    1498                             p_sys->streams.push_back( p_stream ); 
     1507                            msg_Dbg( p_demux, "the file '%s' cannot be opened", s_filename.c_str() ); 
    14991508                        } 
    15001509                    } 
     
    33253334uint64 vlc_stream_io_callback::getFilePointer( void ) 
    33263335{ 
     3336    if ( s == NULL ) 
     3337        return 0; 
    33273338    return stream_Tell( s ); 
    33283339}