[vlc-commits] input: do not allow negative input-repeat

Francois Cartegnie git at videolan.org
Tue Apr 14 17:17:51 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr 14 17:16:53 2015 +0200| [4e4904750cf624cdc9dc1384e02fa302e57db8b5] | committer: Francois Cartegnie

input: do not allow negative input-repeat

Was going into infinite loop in that case.
refs #14389

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

 src/input/input.c   |    2 +-
 src/libvlc-module.c |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/input/input.c b/src/input/input.c
index c005a01..63b4131 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -609,7 +609,7 @@ static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed, mtime_t i_
 static int MainLoopTryRepeat( input_thread_t *p_input, mtime_t *pi_start_mdate )
 {
     int i_repeat = var_GetInteger( p_input, "input-repeat" );
-    if( i_repeat == 0 )
+    if( i_repeat <= 0 )
         return VLC_EGENERIC;
 
     vlc_value_t val;
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 46180f5..ffa0e0c 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1686,6 +1686,7 @@ vlc_module_begin ()
     set_section( N_( "Playback control" ) , NULL)
     add_integer( "input-repeat", 0,
                  INPUT_REPEAT_TEXT, INPUT_REPEAT_LONGTEXT, false )
+        change_integer_range( 0, 65535 )
         change_safe ()
     add_float( "start-time", 0,
                START_TIME_TEXT, START_TIME_LONGTEXT, true )



More information about the vlc-commits mailing list