[vlc-commits] input: check position range for time generated seek

Francois Cartegnie git at videolan.org
Mon Aug 19 16:49:41 CEST 2019


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Aug 14 11:32:55 2019 +0200| [507f88a2e5df4aea6649cd8947e1ddb4e4cf05cc] | committer: Francois Cartegnie

input: check position range for time generated seek

INPUT_CONTROL's one only has range check.
master branch code now use helpers instead.

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=507f88a2e5df4aea6649cd8947e1ddb4e4cf05cc
---

 src/input/input.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/input/input.c b/src/input/input.c
index ef8d95adac..75de527279 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2040,6 +2040,7 @@ static bool Control( input_thread_t *p_input,
                                     DEMUX_GET_LENGTH, &i_length ) && i_length > 0 )
                 {
                     double f_pos = (double)i_time / (double)i_length;
+                    f_pos = VLC_CLIP(f_pos, 0.0, 1.0);
                     i_ret = demux_Control( input_priv(p_input)->master->p_demux,
                                             DEMUX_SET_POSITION, f_pos,
                                             !input_priv(p_input)->b_fast_seek );



More information about the vlc-commits mailing list