]> git.sesse.net Git - vlc/commitdiff
* Fixed another bunch of memory leaks.
authorGildas Bazin <gbazin@videolan.org>
Sun, 8 Oct 2006 00:12:28 +0000 (00:12 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 8 Oct 2006 00:12:28 +0000 (00:12 +0000)
modules/codec/dts.c
modules/codec/ffmpeg/demux.c
modules/demux/mjpeg.c
modules/demux/real.c

index f359b56b60e746075811da5fc0dd15aac904ba6a..52be777650faf81b67db072a148980faf62a04d5 100644 (file)
@@ -99,7 +99,7 @@ vlc_module_begin();
     add_submodule();
     set_description( _("DTS audio packetizer") );
     set_capability( "packetizer", 10 );
-    set_callbacks( OpenPacketizer, NULL );
+    set_callbacks( OpenPacketizer, CloseDecoder );
 vlc_module_end();
 
 /*****************************************************************************
index 9be3f0340a99e9d1f3cd7a380eaf7506b4f4574c..a7da8efb5da51374c99bf0e9d607a14ea9c07b43 100644 (file)
@@ -255,7 +255,9 @@ void E_(CloseDemux)( vlc_object_t *p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys = p_demux->p_sys;
+    unsigned int i;
 
+    FREENULL( p_sys->tk );
     if( p_sys->ic ) av_close_input_file( p_sys->ic );
     if( p_sys->io_buffer ) free( p_sys->io_buffer );
     free( p_sys );
index cf155931b2d098032c6ca1d68f79c1ea659fed16..67824c98027dff6174f5ea4508b0da810b99e7cd 100644 (file)
@@ -215,8 +215,8 @@ static vlc_bool_t CheckMimeHeader( demux_t *p_demux, int *p_header_size )
             msg_Warn( p_demux, "separator %s does not match %s", psz_line,
                       p_sys->psz_separator );
         }
-        free( psz_line );
     }
+    free( psz_line );
     psz_line = GetLine( p_demux, &i_pos );
     while( psz_line && *psz_line )
     {
index e640afdcabd9dc002f2bdbdf8b1beeacb64fa0b9..b7dac5729ea97208d3cc76189570bc80ff2cdc34 100644 (file)
@@ -176,11 +176,16 @@ static void Close( vlc_object_t *p_this )
             if( tk->p_subpackets[ j ] )
                 block_Release( tk->p_subpackets[ j ] );
         }
-        if( !tk->i_subpackets ) free( tk->p_subpackets );
+        if( tk->i_subpackets ) free( tk->p_subpackets );
 
         free( tk );
     }
 
+    if( p_sys->psz_title ) free( p_sys->psz_title );
+    if( p_sys->psz_artist ) free( p_sys->psz_artist );
+    if( p_sys->psz_copyright ) free( p_sys->psz_copyright );
+    if( p_sys->psz_description ) free( p_sys->psz_description );
+
     if( p_sys->i_track > 0 ) free( p_sys->track );
     free( p_sys );
 }
@@ -523,6 +528,8 @@ static int Demux( demux_t *p_demux )
                 p_block->i_dts = p_block->i_pts = i_pts;
                 tk->p_subpackets[i_index] = p_block;
                 tk->i_subpacket++;
+               msg_Err( p_demux, "PTS!DTS: %lld, %lld",
+                        p_block->i_dts, p_block->i_pts);
             }
 
             if( tk->fmt.i_codec == VLC_FOURCC('2','8','_','8') )
@@ -715,7 +722,7 @@ static int HeaderRead( demux_t *p_demux )
         msg_Dbg( p_demux, "object %4.4s size=%d version=%d",
                  (char*)&i_id, i_size, i_version );
 
-        if( i_size < 10 )
+        if( i_size < 10 && i_id != VLC_FOURCC('D','A','T','A') )
         {
             msg_Dbg( p_demux, "invalid size for object %4.4s", (char*)&i_id );
             return VLC_EGENERIC;