[vlc-devel] [PATCH 1/2] dvdread: use designated initializer for callback structure

Alexandre Janniaux ajanni at videolabs.io
Mon Mar 15 17:15:35 UTC 2021


So that we don't give an uninitialized field if the structure expands in
dvdread.
---
 modules/access/dvdread.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index bd5cb84b3a..4f1c8ae9f7 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -205,8 +205,7 @@ static int Open( vlc_object_t *p_this )
     /* Open dvdread */
     const char *psz_path = ToLocale( psz_file );
 #if DVDREAD_VERSION >= DVDREAD_VERSION_CODE(6, 1, 0)
-    dvd_logger_cb cbs;
-    cbs.pf_log = DvdReadLog;
+    dvd_logger_cb cbs = { .pf_log = DvdReadLog };
     dvd_reader_t *p_dvdread = DVDOpen2( p_demux, &cbs, psz_path );
 #else
     dvd_reader_t *p_dvdread = DVDOpen( psz_path );
-- 
2.30.2



More information about the vlc-devel mailing list