From 396184399806312b0cabcf022d5eeb1223cf8c68 Mon Sep 17 00:00:00 2001 From: Steve Lhomme <robux4@ycbcr.xyz> Date: Mon, 24 Feb 2025 11:22:32 +0100 Subject: [PATCH] lua: osd: avoid adding an empty array element Co-authored-by: Alexandre Janniaux <ajanni@videolabs.io> --- modules/lua/libs/osd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/lua/libs/osd.c b/modules/lua/libs/osd.c index 1f9d937ea4ae..ad02fbcf2581 100644 --- a/modules/lua/libs/osd.c +++ b/modules/lua/libs/osd.c @@ -96,9 +96,8 @@ static int vlc_osd_position_from_string( const char *psz_name ) { SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_RIGHT, "top-right" }, { SUBPICTURE_ALIGN_BOTTOM|SUBPICTURE_ALIGN_LEFT, "bottom-left" }, { SUBPICTURE_ALIGN_BOTTOM|SUBPICTURE_ALIGN_RIGHT, "bottom-right" }, - { 0, NULL } }; - int i; - for( i = 0; pp_icons[i].psz_name; i++ ) + }; + for( size_t i = 0; i < ARRAY_SIZE(pp_icons); i++ ) { if( !strcmp( psz_name, pp_icons[i].psz_name ) ) return pp_icons[i].i_position; -- GitLab