[vlc-commits] mp4mux: use vlc_alloc helper

Thomas Guillem git at videolan.org
Sat Nov 11 19:00:19 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sat Nov 11 18:49:10 2017 +0100| [16422e3171a4232df9c3db4675a194cca1c22230] | committer: Thomas Guillem

mp4mux: use vlc_alloc helper

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

 modules/mux/mp4/mp4.c     | 2 +-
 modules/mux/mpeg/tables.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/mux/mp4/mp4.c b/modules/mux/mp4/mp4.c
index 5d13964b87..1017cfb774 100644
--- a/modules/mux/mp4/mp4.c
+++ b/modules/mux/mp4/mp4.c
@@ -1146,7 +1146,7 @@ static bo_t *BuildMoov(sout_mux_t *p_mux)
     mp4mux_trackinfo_t **pp_infos = NULL;
     if(p_sys->i_nb_streams) /* Trackless moov ? */
     {
-        pp_infos = malloc(sizeof(mp4mux_trackinfo_t *) * p_sys->i_nb_streams);
+        pp_infos = vlc_alloc(p_sys->i_nb_streams, sizeof(mp4mux_trackinfo_t *));
         if(!pp_infos)
             return NULL;
         for(unsigned int i=0; i<p_sys->i_nb_streams; i++)
diff --git a/modules/mux/mpeg/tables.c b/modules/mux/mpeg/tables.c
index 9cab7d7fae..ef46a42757 100644
--- a/modules/mux/mpeg/tables.c
+++ b/modules/mux/mpeg/tables.c
@@ -427,7 +427,7 @@ void BuildPMT( dvbpsi_t *p_dvbpsi, vlc_object_t *p_object,
                unsigned i_programs, tsmux_stream_t *p_pmt, const int *pi_programs_number,
                unsigned i_mapped_streams, const pes_mapped_stream_t *p_mapped_streams )
 {
-    dvbpsi_pmt_t *dvbpmt = malloc( i_programs * sizeof(dvbpsi_pmt_t) );
+    dvbpsi_pmt_t *dvbpmt = vlc_alloc( i_programs, sizeof(dvbpsi_pmt_t) );
     if( !dvbpmt )
             return;
 



More information about the vlc-commits mailing list