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 )