[vlc-commits] subsvtt: Don't pass a NULL pointer to qsort

Hugo Beauzée-Luyssen git at videolan.org
Thu May 23 17:21:18 CEST 2019


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon May 20 17:17:49 2019 +0200| [5ef3830f385bfa6a47e9088f9a0d13062cd61c3a] | committer: Hugo Beauzée-Luyssen

subsvtt: Don't pass a NULL pointer to qsort

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5ef3830f385bfa6a47e9088f9a0d13062cd61c3a
---

 modules/codec/webvtt/subsvtt.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/codec/webvtt/subsvtt.c b/modules/codec/webvtt/subsvtt.c
index 27ff9fd72e..f9b686ebda 100644
--- a/modules/codec/webvtt/subsvtt.c
+++ b/modules/codec/webvtt/subsvtt.c
@@ -1856,6 +1856,11 @@ static void Render( decoder_t *p_dec, vlc_tick_t i_start, vlc_tick_t i_stop )
     vlc_array_init( &timedtags );
 
     GetTimedTags( p_sys->p_root->p_child, i_start, i_stop, &timedtags );
+    if( timedtags.i_count == 0 )
+    {
+        vlc_array_clear( &timedtags );
+        return;
+    }
     qsort( timedtags.pp_elems, timedtags.i_count, sizeof(*timedtags.pp_elems), timedtagsArrayCmp );
 
     vlc_tick_t i_substart = i_start;



More information about the vlc-commits mailing list