[vlc-devel] [PATCH] display: assert that we handle all crop cases

Alexandre Janniaux ajanni at videolabs.io
Mon Mar 22 09:01:45 UTC 2021


Otherwise, left/right/top/bottom will not be initialized when used,
probably leading to strange cropping being used. It fixes
-Wmaybe-uninitialized warnings with GCC 10.2.0.
---
 src/video_output/display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 06dd9533db..ff665d2af5 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -471,6 +471,9 @@ static int vout_UpdateSourceCrop(vout_display_t *vd)
             right = -(int)osys->crop.border.right;
             bottom = -(int)osys->crop.border.bottom;
             break;
+        default:
+            /* left/top/right/bottom must be initialized */
+            vlc_assert_unreachable();
     }
 
     const int right_max  = osys->source.i_x_offset
-- 
2.31.0



More information about the vlc-devel mailing list