From a71e14f2909dec29a128aefff83ba9f6d776ba81 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 2 Oct 2010 02:06:53 +0200 Subject: [PATCH] Add a check for i_card_index < 0. --- modules/access/decklink.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/access/decklink.cpp b/modules/access/decklink.cpp index e99bc20cf0..631dc76dae 100644 --- a/modules/access/decklink.cpp +++ b/modules/access/decklink.cpp @@ -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 ) -- 2.39.2