[vlc-devel] [PATCH] display: avoid using memset in vout_display_PlacePicture()

Steve Lhomme robux4 at ycbcr.xyz
Fri Aug 21 10:19:24 CEST 2020


It's only needed when the display has no dimension yet. The rest of the time
we fill all (4) fields of the vout_display_place_t structure.
---
 src/video_output/display.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 8fd444168d0..84284e8f41d 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -150,9 +150,11 @@ void vout_display_PlacePicture(vout_display_place_t *place,
     assert(cfg->window_props.width == 0 && cfg->window_props.height == 0);
 
     /* */
-    memset(place, 0, sizeof(*place));
     if (cfg->display.width == 0 || cfg->display.height == 0)
+    {
+        *place = (vout_display_place_t) { 0 };
         return;
+    }
 
     /* */
     unsigned display_width;
-- 
2.26.2



More information about the vlc-devel mailing list