In streams that do not have SPU ES setting spu-es to zero using libvlc_video_set_spu() results in playback being stopped. This is unwanted behaviour against which this patch protects now.
if( !p_input_thread ) return;
var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL );
+
+ if( val_list.p_list->i_count == 0 )
+ {
+ libvlc_exception_raise( p_e, "Subtitle value out of range" );
+ vlc_object_release( p_input_thread );
+ return;
+ }
+
if( (i_spu < 0) && (i_spu > val_list.p_list->i_count) )
{
libvlc_exception_raise( p_e, "Subtitle value out of range" );