]> git.sesse.net Git - vlc/commitdiff
* modules/demux/mpeg/mpga.c, src/input/stream.c: fixed mem leaks.
authorGildas Bazin <gbazin@videolan.org>
Sat, 3 Jan 2004 00:23:04 +0000 (00:23 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sat, 3 Jan 2004 00:23:04 +0000 (00:23 +0000)
modules/demux/mpeg/mpga.c
src/input/stream.c

index 53e00aa4a884dc4f374bf52593281c11d6d83a7d..ca9bf44ae9e5be1961aebafb42c3c6299f343649 100644 (file)
@@ -2,7 +2,7 @@
  * mpga.c : MPEG-I/II Audio input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: mpga.c,v 1.14 2003/12/27 16:14:48 asmax Exp $
+ * $Id: mpga.c,v 1.15 2004/01/03 00:23:04 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -329,12 +329,14 @@ static int Open( vlc_object_t * p_this )
     {
         vlc_mutex_unlock( &p_input->stream.stream_lock );
         msg_Err( p_input, "cannot init stream" );
+        if( fmt.psz_description ) free( fmt.psz_description );
         goto error;
     }
     p_input->stream.i_mux_rate = p_sys->i_bitrate_avg / 8 / 50;
     vlc_mutex_unlock( &p_input->stream.stream_lock );
 
     p_sys->p_es = es_out_Add( p_input->p_es_out, &fmt );
+    if( fmt.psz_description ) free( fmt.psz_description );
     return VLC_SUCCESS;
 
 error:
index 9f489e7169163433ad85c8eddf8ff082db0d3d32..2f888fcd52f82efe21c2975d5957db20438a9475 100644 (file)
@@ -2,7 +2,7 @@
  * stream.c
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: stream.c,v 1.7 2003/11/21 00:38:01 gbazin Exp $
+ * $Id: stream.c,v 1.8 2004/01/03 00:23:04 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -230,8 +230,12 @@ int stream_Read( stream_t *s, void *p_data, int i_data )
 
         i_count = input_SplitBuffer( s->p_input, &p_packet,
                       __MIN( i_data, (int)s->p_input->i_bufsize ) );
+
         if( i_count <= 0 )
         {
+            if( i_count == 0 )
+                input_DeletePacket( s->p_input->p_method_data, p_packet );
+
             return i_read;
         }