[vlc-devel] commit: Fixed initialization of asf_object_t inside ASF_ReadObject ( fixed invalid (Laurent Aimar )

git version control git at videolan.org
Wed Jul 2 21:55:42 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Jul  2 17:04:50 2008 +0000| [0bac0634f9a8e0ef9d8e78b2abbcae7e49deb4b6]

Fixed initialization of asf_object_t inside ASF_ReadObject (fixed invalid
free).
Removed useless memset after calloc.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0bac0634f9a8e0ef9d8e78b2abbcae7e49deb4b6
---

 modules/demux/asf/libasf.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c
index b80b488..3547308 100644
--- a/modules/demux/asf/libasf.c
+++ b/modules/demux/asf/libasf.c
@@ -619,8 +619,6 @@ static int ASF_ReadObject_codec_list( stream_t *s, asf_object_t *p_obj )
     {
         p_cl->codec = calloc( p_cl->i_codec_entries_count,
                               sizeof( asf_codec_entry_t ) );
-        memset( p_cl->codec, 0,
-                p_cl->i_codec_entries_count * sizeof( asf_codec_entry_t ) );
 
         p_data = p_peek + 44;
         for( i_codec = 0; i_codec < p_cl->i_codec_entries_count; i_codec++ )
@@ -1290,7 +1288,7 @@ static int ASF_ReadObject( stream_t *s, asf_object_t *p_obj,
     if( !p_obj )
         return( 0 );
 
-    memset( p_obj, 0, sizeof( p_obj ) );
+    memset( p_obj, 0, sizeof( *p_obj ) );
 
     if( ASF_ReadObjectCommon( s, p_obj ) )
     {




More information about the vlc-devel mailing list