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

Alexandre Janniaux git at videolan.org
Mon Mar 22 14:54:32 UTC 2021


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Mar 22 10:01:45 2021 +0100| [4d04dd0981d7f9823a3d2887cfe41707aadd2b82] | committer: Alexandre Janniaux

display: assert that we handle all crop cases

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.

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

 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



More information about the vlc-commits mailing list