[vlc-commits] [Git][videolan/vlc][master] 2 commits: Revert "demux: fix libasf memory leak in extended stream properties"

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Jul 27 05:22:13 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
ba892acb by François Cartegnie at 2024-07-27T04:49:42+00:00
Revert "demux: fix libasf memory leak in extended stream properties"

This reverts commit ca495fba086b3464342d43aa868945b3a5159233.

refs #28687

- - - - -
906e3171 by François Cartegnie at 2024-07-27T04:49:42+00:00
demux: libasf: parent stream properties to container

- - - - -


1 changed file:

- modules/demux/asf/libasf.c


Changes:

=====================================
modules/demux/asf/libasf.c
=====================================
@@ -106,6 +106,7 @@ static char *AsfObjectHelperReadString( const uint8_t *p_peek, size_t i_peek, ui
  *
  ****************************************************************************/
 static int ASF_ReadObject( stream_t *, asf_object_t *,  asf_object_t * );
+static void ASF_ParentObject( asf_object_t *p_father, asf_object_t *p_obj );
 
 /****************************************************************************
  *
@@ -918,7 +919,6 @@ static void ASF_FreeObject_extended_stream_properties( asf_object_t *p_obj)
         FREENULL( p_esp->ppsz_stream_name[i] );
     FREENULL( p_esp->pi_stream_name_language );
     FREENULL( p_esp->ppsz_stream_name );
-    FREENULL( p_esp->p_sp );
 }
 
 static int ASF_ReadObject_extended_stream_properties( stream_t *s,
@@ -1021,6 +1021,7 @@ static int ASF_ReadObject_extended_stream_properties( stream_t *s,
         {
             /* This p_sp will be inserted by ReadRoot later */
             p_esp->p_sp = (asf_object_stream_properties_t*)p_sp;
+            ASF_ParentObject( p_obj, p_sp );
         }
     }
 
@@ -1779,31 +1780,9 @@ asf_object_root_t *ASF_ReadObjectRoot( stream_t *s, int b_seekable )
                                 &asf_object_header_extension_guid, 0 );
             if( p_hdr_ext )
             {
-                int i_ext_stream;
-
                 p_root->p_metadata =
                     ASF_FindObject( p_hdr_ext,
                                     &asf_object_metadata_guid, 0 );
-                /* Special case for broken designed file format :( */
-                i_ext_stream = ASF_CountObject( p_hdr_ext,
-                                    &asf_object_extended_stream_properties_guid );
-                for( int i = 0; i < i_ext_stream; i++ )
-                {
-                    asf_object_t *p_esp =
-                        ASF_FindObject( p_hdr_ext,
-                                   &asf_object_extended_stream_properties_guid, i );
-                    if( p_esp->ext_stream.p_sp )
-                    {
-                        asf_object_t *p_sp =
-                                         (asf_object_t*)p_esp->ext_stream.p_sp;
-
-                        /* Insert this p_sp */
-                        p_root->p_hdr->p_last->common.p_next = p_sp;
-                        p_root->p_hdr->p_last = p_sp;
-
-                        p_sp->common.p_father = (asf_object_t*)p_root->p_hdr;
-                    }
-                }
             }
 
             ASF_ObjectDumpDebug( VLC_OBJECT(s),



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/da5ddd4d9c9ef83748c2def39d548c9bb1985168...906e31714f751d2cd2d762d59c2384ff4e1e2a75

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/da5ddd4d9c9ef83748c2def39d548c9bb1985168...906e31714f751d2cd2d762d59c2384ff4e1e2a75
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list