[vlc-commits] gradient: use vlc_alloc helper

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


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sat Nov 11 18:51:53 2017 +0100| [44395f9d8fa83baa10b19338913f866d0b5c8181] | committer: Thomas Guillem

gradient: use vlc_alloc helper

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

 modules/video_filter/gradient.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/video_filter/gradient.c b/modules/video_filter/gradient.c
index 7479377d8d..7f9f000337 100644
--- a/modules/video_filter/gradient.c
+++ b/modules/video_filter/gradient.c
@@ -351,7 +351,7 @@ static void FilterGradient( filter_t *p_filter, picture_t *p_inpic,
     uint32_t *p_smooth;
     if( !p_filter->p_sys->p_buf32 )
         p_filter->p_sys->p_buf32 =
-        (uint32_t *)malloc( i_num_lines * i_src_visible * sizeof(uint32_t));
+            vlc_alloc( i_num_lines * i_src_visible, sizeof(uint32_t));
     p_smooth = p_filter->p_sys->p_buf32;
 
     if( !p_smooth ) return;
@@ -473,17 +473,17 @@ static void FilterEdge( filter_t *p_filter, picture_t *p_inpic,
 
     if( !p_filter->p_sys->p_buf32 )
         p_filter->p_sys->p_buf32 =
-        (uint32_t *)malloc( i_num_lines * i_src_visible * sizeof(uint32_t));
+            vlc_alloc( i_num_lines * i_src_visible, sizeof(uint32_t));
     p_smooth = p_filter->p_sys->p_buf32;
 
     if( !p_filter->p_sys->p_buf32_bis )
         p_filter->p_sys->p_buf32_bis =
-        (uint32_t *)malloc( i_num_lines * i_src_visible * sizeof(uint32_t));
+            vlc_alloc( i_num_lines * i_src_visible, sizeof(uint32_t));
     p_grad = p_filter->p_sys->p_buf32_bis;
 
     if( !p_filter->p_sys->p_buf8 )
         p_filter->p_sys->p_buf8 =
-        (uint8_t *)malloc( i_num_lines * i_src_visible * sizeof(uint8_t));
+            vlc_alloc( i_num_lines * i_src_visible, sizeof(uint8_t));
     p_theta = p_filter->p_sys->p_buf8;
 
     if( !p_smooth || !p_grad || !p_theta ) return;
@@ -632,10 +632,10 @@ static void FilterHough( filter_t *p_filter, picture_t *p_inpic,
     double d_cos;
     uint32_t *p_smooth;
 
-    int *p_hough = malloc( i_diag * i_nb_steps * sizeof(int) );
+    int *p_hough = vlc_alloc( i_diag * i_nb_steps, sizeof(int) );
     if( ! p_hough ) return;
 
-    p_smooth = (uint32_t *)malloc( i_num_lines*i_src_visible*sizeof(uint32_t));
+    p_smooth = vlc_alloc( i_num_lines * i_src_visible, sizeof(uint32_t));
     if( !p_smooth )
     {
         free( p_hough );
@@ -645,7 +645,7 @@ static void FilterHough( filter_t *p_filter, picture_t *p_inpic,
     if( ! p_pre_hough )
     {
         msg_Dbg(p_filter, "Starting precalculation");
-        p_pre_hough = malloc( i_num_lines*i_src_visible*i_nb_steps*sizeof(int));
+        p_pre_hough = vlc_alloc( i_num_lines*i_src_visible*i_nb_steps,sizeof(int));
         if( ! p_pre_hough )
         {
             free( p_smooth );



More information about the vlc-commits mailing list