Browse Source

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 b26cb55943)
cherry-pick-c5513cf9
Thomas Guillem 1 year ago
committed by Steve Lhomme
parent
commit
9fbced240e
  1. 5
      modules/demux/webvtt.c

5
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 );

Loading…
Cancel
Save