Changeset 08addc5ab32adc2f629e08304cd2cca8eacf0c7b

Show
Ignore:
Timestamp:
17/06/06 00:42:00 (2 years ago)
Author:
Christophe Mutricy <xtophe@videolan.org>
git-committer:
Christophe Mutricy <xtophe@videolan.org> 1150497720 +0000
git-parent:

[28422e789b04d3173cfb52c5fe1b3e29bd0c51f9]

git-author:
Christophe Mutricy <xtophe@videolan.org> 1150497720 +0000
Message:

Fix a bunch of segfaults. It may be heavy handed and breaking other stuffs. zorglub to review

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/input/input.c

    r28422e7 r08addc5  
    700700        p_input->counters.p_sout_sent_packets = NULL; 
    701701        p_input->counters.p_sout_sent_bytes = NULL; 
    702         p_input->counters.p_demux_bitrate->update_interval = 1000000; 
    703         p_input->counters.p_input_bitrate->update_interval = 1000000; 
     702        if( p_input->counters.p_demux_bitrate ) 
     703            p_input->counters.p_demux_bitrate->update_interval = 1000000; 
     704        if( p_input->counters.p_input_bitrate ) 
     705            p_input->counters.p_input_bitrate->update_interval = 1000000; 
    704706        vlc_mutex_init( p_input, &p_input->counters.counters_lock ); 
    705707 
     
    719721            INIT_COUNTER (sout_sent_bytes, INTEGER, COUNTER ); 
    720722            INIT_COUNTER( sout_send_bitrate, FLOAT, DERIVATIVE ); 
    721             p_input->counters.p_sout_send_bitrate->update_interval = 1000000; 
     723            if( p_input->counters.p_sout_send_bitrate ) 
     724                p_input->counters.p_sout_send_bitrate->update_interval = 1000000; 
    722725        } 
    723726        free( psz ); 
  • src/misc/stats.c

    rbaacaea r08addc5  
    381381{ 
    382382    int i; 
    383     for( i = p_c->i_samples - 1 ; i >= 0 ; i-- ) 
    384     { 
    385         counter_sample_t *p_s = p_c->pp_samples[i]; 
    386         REMOVE_ELEM( p_c->pp_samples, p_c->i_samples, i ); 
    387         free( p_s ); 
    388     } 
     383    if( p_c ) 
     384    { 
     385        for( i = p_c->i_samples - 1 ; i >= 0 ; i-- ) 
     386        { 
     387            counter_sample_t *p_s = p_c->pp_samples[i]; 
     388            REMOVE_ELEM( p_c->pp_samples, p_c->i_samples, i ); 
     389            free( p_s ); 
     390        } 
    389391    if( p_c->psz_name ) free( p_c->psz_name ); 
    390392    free( p_c ); 
     393    } 
    391394} 
    392395