Changeset 380edbae4061b349232364c7d7989c4ef8e8931f

Show
Ignore:
Timestamp:
26/11/03 09:18:09 (5 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1069834689 +0000
git-parent:

[695943b9f6d103e9540353dfdb9c5ebfcba4d50b]

git-author:
Gildas Bazin <gbazin@videolan.org> 1069834689 +0000
Message:

* ALL: fixed memory leaks.
* modules/demux/mp4/libmp4.c: fixed parsing of the "wave" tag (I'm sure there's a better fix but this one works).
* modules/demux/ogg.c: another seeking fix (We also need to flush the per stream buffer with ogg_stream_reset()).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/codec/ffmpeg/postprocess.c

    rb367420 r380edba  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: postprocess.c,v 1.5 2003/11/24 00:01:42 gbazin Exp $ 
     5 * $Id: postprocess.c,v 1.6 2003/11/26 08:18:09 gbazin Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    8282        var_Create( p_dec, "ffmpeg-pp-q", 
    8383                    VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_DOINHERIT ); 
    84         text.psz_string = _("Post-Processing"); 
     84        text.psz_string = _("Post processing"); 
    8585        var_Change( p_dec, "ffmpeg-pp-q", VLC_VAR_SETTEXT, &text, NULL ); 
    8686 
     
    201201 
    202202    var_DelCallback( p_dec, "ffmpeg-pp-q", PPQCallback, p_sys ); 
     203 
     204    if( p_sys ) free( p_sys ); 
    203205} 
    204206 
  • modules/demux/avi/avi.c

    r98d646e r380edba  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: avi.c,v 1.76 2003/11/24 13:40:03 gbazin Exp $ 
     5 * $Id: avi.c,v 1.77 2003/11/26 08:18:09 gbazin Exp $ 
    66 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
    77 * 
     
    279279                fmt.audio.i_blockalign      = p_auds->p_wf->nBlockAlign; 
    280280                fmt.audio.i_bitspersample   = p_auds->p_wf->wBitsPerSample; 
    281                 if( ( fmt.i_extra = __MIN( p_auds->p_wf->cbSize, 
    282                                            p_auds->i_chunk_size - sizeof(WAVEFORMATEX) ) ) > 0 ) 
    283                 { 
    284                     fmt.p_extra = malloc( fmt.i_extra ); 
    285                     memcpy( fmt.p_extra, &p_auds->p_wf[1], fmt.i_extra ); 
    286                 } 
     281                fmt.i_extra = __MIN( p_auds->p_wf->cbSize, 
     282                    p_auds->i_chunk_size - sizeof(WAVEFORMATEX) ); 
     283                fmt.p_extra = &p_auds->p_wf[1]; 
    287284                msg_Dbg( p_input, "stream[%d] audio(0x%x) %d channels %dHz %dbits", 
    288                          i, 
    289                          p_auds->p_wf->wFormatTag, p_auds->p_wf->nChannels, 
     285                         i, p_auds->p_wf->wFormatTag, p_auds->p_wf->nChannels, 
    290286                         p_auds->p_wf->nSamplesPerSec, p_auds->p_wf->wBitsPerSample); 
    291287                break; 
     
    299295                fmt.video.i_width  = p_vids->p_bih->biWidth; 
    300296                fmt.video.i_height = p_vids->p_bih->biHeight; 
    301                 if( ( fmt.i_extra = __MIN( p_vids->p_bih->biSize - sizeof( BITMAPINFOHEADER ), 
    302                                            p_vids->i_chunk_size - sizeof(BITMAPINFOHEADER) ) ) > 0 ) 
    303                 { 
    304                     fmt.p_extra = malloc( fmt.i_extra ); 
    305                     memcpy( fmt.p_extra, &p_vids->p_bih[1], fmt.i_extra ); 
    306                 } 
     297                fmt.i_extra = 
     298                    __MIN( p_vids->p_bih->biSize - sizeof( BITMAPINFOHEADER ), 
     299                           p_vids->i_chunk_size - sizeof(BITMAPINFOHEADER) ); 
     300                fmt.p_extra = &p_vids->p_bih[1]; 
    307301                msg_Dbg( p_input, "stream[%d] video(%4.4s) %dx%d %dbpp %ffps", 
    308302                        i, 
  • modules/demux/mp4/libmp4.c

    r67c26fd r380edba  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: libmp4.c,v 1.34 2003/10/07 14:59:10 gbazin Exp $ 
     5 * $Id: libmp4.c,v 1.35 2003/11/26 08:18:09 gbazin Exp $ 
    66 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
    77 * 
     
    12051205    MP4_READBOX_ENTER( MP4_Box_data_sample_soun_t ); 
    12061206 
     1207    /* Sanity check needed because the "wave" box does also contain an 
     1208     * "mp4a" box that we don't understand. */ 
     1209    if( i_read < 28 ) 
     1210    { 
     1211        i_read -= 30; 
     1212        MP4_READBOX_EXIT( 0 ); 
     1213    } 
     1214 
    12071215    for( i = 0; i < 6 ; i++ ) 
    12081216    { 
     
    12151223     * XXX hack -> produce a copy of the nearly complete chunk 
    12161224     */ 
    1217     if( i_read > 0 ) 
    1218     { 
    1219         p_box->data.p_sample_soun->i_qt_description = i_read; 
    1220         p_box->data.p_sample_soun->p_qt_description = malloc( i_read ); 
    1221         memcpy( p_box->data.p_sample_soun->p_qt_description, 
    1222                 p_peek, 
    1223                 i_read ); 
    1224     } 
    1225     else 
    1226     { 
    1227         p_box->data.p_sample_soun->i_qt_description = 0; 
    1228         p_box->data.p_sample_soun->p_qt_description = NULL; 
    1229     } 
     1225    p_box->data.p_sample_soun->i_qt_description = i_read; 
     1226    p_box->data.p_sample_soun->p_qt_description = malloc( i_read ); 
     1227    memcpy( p_box->data.p_sample_soun->p_qt_description, p_peek, i_read ); 
    12301228 
    12311229    MP4_GET2BYTES( p_box->data.p_sample_soun->i_qt_version ); 
  • modules/demux/ogg.c

    r9c37455 r380edba  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001-2003 VideoLAN 
    5  * $Id: ogg.c,v 1.46 2003/11/23 13:15:27 gbazin Exp $ 
     5 * $Id: ogg.c,v 1.47 2003/11/26 08:18:09 gbazin Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    7979    mtime_t i_pcr; 
    8080    int     b_reinit; 
    81     int     i_prev_sync_state; 
    8281 
    8382    /* stream state */ 
     
    10291028    p_ogg->i_eos = 0; 
    10301029 
    1031     p_ogg->i_prev_sync_state = SYNCHRO_REINIT; 
    1032  
    10331030    return 0; 
    10341031 
     
    11711168            p_stream->i_pcr = -1; 
    11721169            p_stream->i_interpolated_pcr = -1; 
     1170            ogg_stream_reset( &p_stream->os ); 
    11731171        } 
    1174         if( p_ogg->i_prev_sync_state != SYNCHRO_REINIT ) 
    1175             ogg_sync_reset( &p_ogg->oy ); 
    1176     } 
    1177  
    1178     p_ogg->i_prev_sync_state = 
    1179         p_input->stream.p_selected_program->i_synchro_state; 
     1172        ogg_sync_reset( &p_ogg->oy ); 
     1173    } 
    11801174 
    11811175    /* 
     
    12261220                    { 
    12271221                        input_ClockManageRef( p_input, 
    1228                             p_input->stream.p_selected_program, p_ogg->i_pcr ); 
     1222                      p_input->stream.p_selected_program, 
     1223                      p_stream->i_pcr ); 
    12291224                    } 
    12301225                    continue; 
     
    12491244    } 
    12501245 
    1251     if( p_input->stream.p_selected_program->i_synchro_state != SYNCHRO_REINIT
     1246    if( p_ogg->i_pcr >= 0
    12521247    { 
    12531248        input_ClockManageRef( p_input, p_input->stream.p_selected_program, 
  • modules/packetizer/mpeg4video.c

    r3557949 r380edba  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: mpeg4video.c,v 1.16 2003/11/18 20:15:38 fenrir Exp $ 
     5 * $Id: mpeg4video.c,v 1.17 2003/11/26 08:18:09 gbazin Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    129129    p_sys->b_vop = VLC_FALSE; 
    130130    p_sys->i_buffer = 0; 
    131     p_sys->i_buffer_size = 10000; 
    132     p_sys->p_buffer = malloc( p_sys->i_buffer_size )
     131    p_sys->i_buffer_size = 0; 
     132    p_sys->p_buffer = 0
    133133 
    134134    /* Setup properties */ 
     
    168168    decoder_t *p_dec = (decoder_t*)p_this; 
    169169 
     170    if( p_dec->p_sys->p_buffer ) free( p_dec->p_sys->p_buffer ); 
    170171    free( p_dec->p_sys ); 
    171172} 
  • src/input/input_dec.c

    r89fd537 r380edba  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: input_dec.c,v 1.79 2003/11/24 23:22:01 gbazin Exp $ 
     5 * $Id: input_dec.c,v 1.80 2003/11/26 08:18:09 gbazin Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    611611 
    612612    if( p_dec->p_owner->p_sout ) 
     613    { 
    613614        sout_InputDelete( p_dec->p_owner->p_sout ); 
     615        if( p_dec->p_owner->sout.i_extra ) free(p_dec->p_owner->sout.p_extra); 
     616    } 
     617 
     618    if( p_dec->fmt_in.i_extra ) free( p_dec->fmt_in.p_extra ); 
     619    if( p_dec->fmt_out.i_extra ) free( p_dec->fmt_out.p_extra ); 
    614620 
    615621    free( p_dec->p_owner ); 
  • src/video_output/video_output.c

    r3439df8 r380edba  
    66 ***************************************************************************** 
    77 * Copyright (C) 2000-2001 VideoLAN 
    8  * $Id: video_output.c,v 1.240 2003/11/24 00:39:02 fenrir Exp $ 
     8 * $Id: video_output.c,v 1.241 2003/11/26 08:18:09 gbazin Exp $ 
    99 * 
    1010 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    439439    { 
    440440        var_Set( p_vout, "deinterlace", val ); 
     441        if( val.psz_string ) free( val.psz_string ); 
    441442    } 
    442443    var_AddCallback( p_vout, "deinterlace", DeinterlaceCallback, NULL ); 
     
    447448    var_Change( p_vout, "filter", VLC_VAR_SETTEXT, &text, NULL ); 
    448449    var_Change( p_vout, "filter", VLC_VAR_INHERITVALUE, &val, NULL ); 
    449     if( var_Get( p_vout, "filter", &val ) == VLC_SUCCESS
     450    if( val.psz_string
    450451    { 
    451452        var_Set( p_vout, "filter", val ); 
     453        free( val.psz_string ); 
    452454    } 
    453455    var_AddCallback( p_vout, "filter", FilterCallback, NULL ); 
     
    498500    p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST,  
    499501                                  FIND_ANYWHERE ); 
     502 
     503    if( p_vout->psz_filter_chain ) free( p_vout->psz_filter_chain ); 
    500504 
    501505    /* Free structure */