]> git.sesse.net Git - vlc/commitdiff
* all: shut up valgrind ;) (memory leacks and one overead/overwrite).
authorLaurent Aimar <fenrir@videolan.org>
Sat, 3 May 2003 01:12:13 +0000 (01:12 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 3 May 2003 01:12:13 +0000 (01:12 +0000)
modules/demux/avi/avi.c
modules/demux/avi/avi.h
modules/demux/avi/libavi.c
modules/packetizer/copy.c
modules/stream_out/transcode.c

index f6839007bf49eacf9bd9e42e845cf53c9b314798..da5200a93edc5fd4f1edf4655965b740ce01331c 100644 (file)
@@ -2,7 +2,7 @@
  * avi.c : AVI file Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: avi.c,v 1.45 2003/04/28 23:25:50 fenrir Exp $
+ * $Id: avi.c,v 1.46 2003/05/03 01:12:13 fenrir Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -1248,6 +1248,10 @@ static int AVIInit( vlc_object_t * p_this )
         p_es->i_cat = p_info->i_cat;
         if( p_es->i_cat == AUDIO_ES )
         {
+            if( i_init_size < sizeof( WAVEFORMATEX ) )
+            {
+                i_init_size = sizeof( WAVEFORMATEX );
+            }
             p_es->p_waveformatex = malloc( i_init_size );
             memcpy( p_es->p_waveformatex, p_init_data, i_init_size );
         }
index 39e7e57fe2a6f570869ec05604b6cb9030d9ef20..c77973f4ecbd692f2b70b2b975a88be30192e18c 100644 (file)
@@ -2,7 +2,7 @@
  * avi.h : AVI file Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: avi.h,v 1.9 2003/04/27 11:55:03 fenrir Exp $
+ * $Id: avi.h,v 1.10 2003/05/03 01:12:13 fenrir Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -27,7 +27,7 @@ typedef struct avi_packet_s
     uint32_t     i_size;
     vlc_fourcc_t i_type;     // only for AVIFOURCC_LIST
 
-    uint8_t  i_peek[8];  //first 8 bytes
+    uint8_t      i_peek[8];  //first 8 bytes
 
     unsigned int i_stream;
     unsigned int i_cat;
index b822f069bf93e598a0718111214cafee9c54ea67..da927c3a02b3c6cbabc21685cbb845ed81c711e9 100644 (file)
@@ -2,7 +2,7 @@
  * libavi.c :
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: libavi.c,v 1.19 2003/04/27 13:55:51 fenrir Exp $
+ * $Id: libavi.c,v 1.20 2003/05/03 01:12:13 fenrir Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -527,7 +527,7 @@ static int AVI_ChunkRead_strf( input_thread_t *p_input,
     {
         case( AVIFOURCC_auds ):
             p_chk->strf.auds.i_cat = AUDIO_ES;
-            p_chk->strf.auds.p_wf = malloc( p_chk->common.i_chunk_size );
+            p_chk->strf.auds.p_wf = malloc( __MAX( p_chk->common.i_chunk_size, sizeof( WAVEFORMATEX ) ) );
             AVI_READ2BYTES( p_chk->strf.auds.p_wf->wFormatTag );
             AVI_READ2BYTES( p_chk->strf.auds.p_wf->nChannels );
             AVI_READ4BYTES( p_chk->strf.auds.p_wf->nSamplesPerSec );
index 9f300a5808f4c0f851699324cc904499b63ee358..d4e8e94fca33b80a4110e5f73c2ebbbf8e958638 100644 (file)
@@ -2,7 +2,7 @@
  * copy.c
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: copy.c,v 1.8 2003/05/02 00:33:42 fenrir Exp $
+ * $Id: copy.c,v 1.9 2003/05/03 01:12:13 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
@@ -542,6 +542,7 @@ static void EndThread ( packetizer_thread_t *p_pack)
     {
         sout_InputDelete( p_pack->p_sout_input );
     }
+    free( p_pack );
 }
 
 static void input_ShowPES( decoder_fifo_t *p_fifo, pes_packet_t **pp_pes )
index c2d047caa1d6fe68722bd4a96767f4197e64b4f7..0e64afa261779929dd75c1f9a82b7774c32a112d 100644 (file)
@@ -2,7 +2,7 @@
  * transcode.c
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: transcode.c,v 1.9 2003/05/02 19:37:08 fenrir Exp $
+ * $Id: transcode.c,v 1.10 2003/05/03 01:12:13 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -585,7 +585,9 @@ static void transcode_audio_ffmpeg_close ( sout_stream_t *p_stream, sout_stream_
     free( id->ff_dec_c );
     free( id->ff_enc_c );
 
+    free( id->p_buffer_in );
     free( id->p_buffer );
+    free( id->p_buffer_out );
 }
 
 static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_id_t *id,