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

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Jul 31 13:57:21 UTC 2025



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
9fbced24 by Thomas Guillem at 2025-07-31T13:21:10+00:00
webvtt: fix null pointer passed in qsort

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

(cherry picked from commit b26cb55943993b8060754f9757f8ea354736b8e2)

- - - - -


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"
 
@@ -325,6 +326,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/9fbced240edf4cfd0502cd7344818e1e5f5df702

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