[vlc-commits] stream_filter: smooth: fix negative array access

Francois Cartegnie git at videolan.org
Wed Mar 12 18:48:18 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Mar 12 18:30:31 2014 +0100| [651695499b6f100ea254d47f3481629ee6a99865] | committer: Francois Cartegnie

stream_filter: smooth: fix negative array access

cid #1048853

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

 modules/stream_filter/smooth/downloader.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/stream_filter/smooth/downloader.c b/modules/stream_filter/smooth/downloader.c
index b5aee73..a1291ef 100644
--- a/modules/stream_filter/smooth/downloader.c
+++ b/modules/stream_filter/smooth/downloader.c
@@ -378,6 +378,11 @@ static int Download( stream_t *s, sms_stream_t *sms )
     stream_sys_t *p_sys = s->p_sys;
 
     int index = es_cat_to_index( sms->type );
+    if ( unlikely( index == -1 ) )
+    {
+        msg_Err( s, "invalid stream type" );
+        return VLC_EGENERIC;
+    }
     int64_t start_time = p_sys->download.lead[index];
 
     quality_level_t *qlevel = get_qlevel( sms, sms->download_qlvl );



More information about the vlc-commits mailing list