[vlc-commits] [Git][videolan/vlc][master] wall: do not allocate dummy picture on stack

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Sun May 29 10:55:21 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
350ea55e by Rémi Denis-Courmont at 2022-05-29T10:25:07+00:00
wall: do not allocate dummy picture on stack

Fixes #27011.

- - - - -


1 changed file:

- modules/video_splitter/wall.c


Changes:

=====================================
modules/video_splitter/wall.c
=====================================
@@ -267,17 +267,20 @@ static int Filter( video_splitter_t *p_splitter, picture_t *pp_dst[], picture_t
             picture_t *p_dst = pp_dst[p_output->i_output];
 
             /* */
-            picture_t tmp = *p_src;
-            for( int i = 0; i < tmp.i_planes; i++ )
+            for( int i = 0; i < p_src->i_planes; i++ )
             {
-                plane_t *p0 = &tmp.p[0];
-                plane_t *p = &tmp.p[i];
-                const int i_y = p_output->i_top  * p->i_visible_pitch / p0->i_visible_pitch;
-                const int i_x = p_output->i_left * p->i_visible_lines / p0->i_visible_lines;
-
-                p->p_pixels += i_y * p->i_pitch + ( i_x - (i_x % p->i_pixel_pitch));
+                const plane_t *p0 = p_src->p;
+                plane_t p = p_src->p[i];
+                const int i_y = p_output->i_top  * p.i_visible_pitch
+                                                   / p0->i_visible_pitch;
+                const int i_x = p_output->i_left * p.i_visible_lines
+                                                   / p0->i_visible_lines;
+
+                p.p_pixels += i_y * p.i_pitch
+                               + (i_x - (i_x % p.i_pixel_pitch));
+                plane_CopyPixels(p_dst->p + i, &p);
             }
-            picture_Copy( p_dst, &tmp );
+            picture_CopyProperties(p_dst, p_src);
         }
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/350ea55ea5125c8873449471ef0ead41d8d41905

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