[vlc-commits] [Git][videolan/vlc][3.0.x] demux: asf: fix local buffer leak

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Feb 17 08:46:05 UTC 2025



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
3758d15c by Steve Lhomme at 2025-02-14T15:18:15+01:00
demux: asf: fix local buffer leak

Fixes #28998

(cherry picked from commit 430792dc3f9f0e7bb526c38564f57e3b7fab4a0a)

- - - - -


1 changed file:

- modules/demux/asf/asf.c


Changes:

=====================================
modules/demux/asf/asf.c
=====================================
@@ -1222,9 +1222,6 @@ static int DemuxInit( demux_t *p_demux )
         es_format_Clean( &fmt );
     }
 
-    free( fmt_priorities_ex.pi_stream_numbers );
-    free( fmt_priorities_bitrate_ex.pi_stream_numbers );
-
     p_sys->i_data_begin = p_sys->p_root->p_data->i_object_pos + 50;
     if( p_sys->p_root->p_data->i_object_size > 50 ) /* see libasf ASF_OBJECT_DATA <= 50 handling */
     { /* local file */
@@ -1357,6 +1354,8 @@ static int DemuxInit( demux_t *p_demux )
         }
     }
 #endif
+    free( fmt_priorities_ex.pi_stream_numbers );
+    free( fmt_priorities_bitrate_ex.pi_stream_numbers );
 
     p_sys->packet_sys.pi_preroll = &p_sys->p_fp->i_preroll;
     p_sys->packet_sys.pi_preroll_start = &p_sys->i_preroll_start;
@@ -1364,6 +1363,8 @@ static int DemuxInit( demux_t *p_demux )
     return VLC_SUCCESS;
 
 error:
+    free( fmt_priorities_ex.pi_stream_numbers );
+    free( fmt_priorities_bitrate_ex.pi_stream_numbers );
     DemuxEnd( p_demux );
     return VLC_EGENERIC;
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3758d15c000c9ec10711ca7e9580e43ba09601df

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3758d15c000c9ec10711ca7e9580e43ba09601df
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