[vlc-commits] asf: fix vlc_array_remove sign (cid #1401378)

Thomas Guillem git at videolan.org
Thu Feb 23 14:46:13 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Feb 23 14:32:39 2017 +0100| [da00c2da422fdd77c21173152262626af2edbe89] | committer: Thomas Guillem

asf: fix vlc_array_remove sign (cid #1401378)

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

 modules/mux/asf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/mux/asf.c b/modules/mux/asf.c
index f30c1ab..5a7b369 100644
--- a/modules/mux/asf.c
+++ b/modules/mux/asf.c
@@ -659,7 +659,9 @@ static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
 
     if( p_sys->b_asf_http )
     {
-        vlc_array_remove( &p_sys->tracks, vlc_array_index_of_item( &p_sys->tracks, tk ) );
+        ssize_t i_idx = vlc_array_index_of_item( &p_sys->tracks, tk );
+        if( i_idx >= 0 )
+            vlc_array_remove( &p_sys->tracks, (size_t) i_idx );
         p_sys->b_write_header = true;
     }
 }



More information about the vlc-commits mailing list