[vlc-commits] [Git][videolan/vlc][master] lua: osd: avoid adding an empty array element

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Feb 27 11:43:39 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
39618439 by Steve Lhomme at 2025-02-27T11:31:20+00:00
lua: osd: avoid adding an empty array element

Co-authored-by: Alexandre Janniaux <ajanni at videolabs.io>

- - - - -


1 changed file:

- modules/lua/libs/osd.c


Changes:

=====================================
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;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/396184399806312b0cabcf022d5eeb1223cf8c68

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