[vlc-commits] linsys: use vlc_alloc helper

Thomas Guillem git at videolan.org
Sat Nov 11 18:59:45 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sat Nov 11 18:38:14 2017 +0100| [dbf7961151f7c9283c914fcdaaca0781d5334b11] | committer: Thomas Guillem

linsys: use vlc_alloc helper

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

 modules/access/linsys/linsys_hdsdi.c | 4 ++--
 modules/access/linsys/linsys_sdi.c   | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/access/linsys/linsys_hdsdi.c b/modules/access/linsys/linsys_hdsdi.c
index 4b48426383..2ebcb73370 100644
--- a/modules/access/linsys/linsys_hdsdi.c
+++ b/modules/access/linsys/linsys_hdsdi.c
@@ -840,7 +840,7 @@ static int InitCapture( demux_t *p_demux )
 #ifdef HAVE_MMAP_SDIAUDIO
         i_bufmemsize = ((p_sys->i_abuffer_size + i_page_size - 1) / i_page_size)
                          * i_page_size;
-        p_sys->pp_abuffers = malloc( p_sys->i_abuffers * sizeof(uint8_t *) );
+        p_sys->pp_abuffers = vlc_alloc( p_sys->i_abuffers, sizeof(uint8_t *) );
         if( unlikely( !p_sys->pp_abuffers ) )
             return VLC_ENOMEM;
         for ( unsigned int i = 0; i < p_sys->i_abuffers; i++ )
@@ -895,7 +895,7 @@ static int InitCapture( demux_t *p_demux )
     p_sys->i_current_vbuffer = 0;
     i_bufmemsize = ((p_sys->i_vbuffer_size + i_page_size - 1) / i_page_size)
                      * i_page_size;
-    p_sys->pp_vbuffers = malloc( p_sys->i_vbuffers * sizeof(uint8_t *) );
+    p_sys->pp_vbuffers = vlc_alloc( p_sys->i_vbuffers, sizeof(uint8_t *) );
     if( unlikely( !p_sys->pp_vbuffers ) )
         return VLC_ENOMEM;
     for ( unsigned int i = 0; i < p_sys->i_vbuffers; i++ )
diff --git a/modules/access/linsys/linsys_sdi.c b/modules/access/linsys/linsys_sdi.c
index 23990b7da0..67efda8b40 100644
--- a/modules/access/linsys/linsys_sdi.c
+++ b/modules/access/linsys/linsys_sdi.c
@@ -780,7 +780,7 @@ static int InitTelx( demux_t *p_demux )
         return VLC_EGENERIC;
     }
 
-    p_sys->p_telx_buffer = malloc( p_sys->i_telx_count * p_sys->i_width * 4 );
+    p_sys->p_telx_buffer = vlc_alloc( p_sys->i_telx_count * p_sys->i_width, 4 );
     if( !p_sys->p_telx_buffer )
     {
         vbi_raw_decoder_destroy ( &p_sys->rd_telx );
@@ -861,7 +861,7 @@ static int InitAudio( demux_t *p_demux, sdi_audio_t *p_audio )
     p_audio->i_max_samples        = (float)p_audio->i_nb_samples *
                                     (1.f + SAMPLERATE_TOLERANCE);
 
-    p_audio->p_buffer             = malloc( p_audio->i_max_samples * sizeof(int16_t) * 2 );
+    p_audio->p_buffer             = vlc_alloc( p_audio->i_max_samples, sizeof(int16_t) * 2 );
     p_audio->i_left_samples       = p_audio->i_right_samples = 0;
     p_audio->i_block_number       = 0;
 
@@ -1737,7 +1737,7 @@ static int InitCapture( demux_t *p_demux )
 
     i_bufmemsize = ((p_sys->i_buffer_size + i_page_size - 1) / i_page_size)
                      * i_page_size;
-    p_sys->pp_buffers = malloc( p_sys->i_buffers * sizeof(uint8_t *) );
+    p_sys->pp_buffers = vlc_alloc( p_sys->i_buffers, sizeof(uint8_t *) );
     if( !p_sys->pp_buffers )
         return VLC_ENOMEM;
 



More information about the vlc-commits mailing list