]> git.sesse.net Git - vlc/commitdiff
Add a check for i_card_index < 0.
authorSteinar H. Gunderson <steinar+vlc@gunderson.no>
Sat, 2 Oct 2010 00:06:53 +0000 (02:06 +0200)
committerSteinar H. Gunderson <steinar+vlc@gunderson.no>
Sat, 2 Oct 2010 00:06:53 +0000 (02:06 +0200)
modules/access/decklink.cpp

index e99bc20cf0550105899df6b7c919440173123dea..631dc76dae9defa4daf02b836d8d8b62fdc6a567 100644 (file)
@@ -299,6 +299,12 @@ static int Open( vlc_object_t *p_this )
     HRESULT result;
 
     i_card_index = var_InheritInteger( p_demux, "decklink-card-index" );
+    if( i_card_index < 0 )
+    {
+        msg_Err( p_demux, "Invalid card index %d", i_card_index );
+        goto finish;
+    }
+
     for( int i = 0; i <= i_card_index; ++i )
     {
         if( p_sys->p_card )