[vlc-commits] [Git][videolan/vlc][master] webvtt: fix null pointer passed in qsort

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sat Jul 26 12:31:12 UTC 2025



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
b26cb559 by Thomas Guillem at 2025-07-26T09:07:03+00:00
webvtt: fix null pointer passed in qsort

>From UBSAN: null pointer passed as argument 1, which is declared to never be null

- - - - -


1 changed file:

- modules/demux/webvtt.c


Changes:

=====================================
modules/demux/webvtt.c
=====================================
@@ -29,6 +29,7 @@
 #include <vlc_common.h>
 #include <vlc_demux.h>
 #include <vlc_memstream.h>
+#include <assert.h>
 
 #include "../codec/webvtt/webvtt.h"
 
@@ -319,6 +320,10 @@ static void BuildIndex( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
+    if( p_sys->index.i_count == 0 )
+        return;
+    assert( p_sys->index.p_array != NULL );
+
     /* Order time entries ascending, start time before end time */
     qsort( p_sys->index.p_array, p_sys->index.i_count,
            sizeof(struct index_entry_s), index_Compare );



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

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