[vlc-devel] [PATCH] fix off-by-one error

Christoph Pfister christophpfister at gmail.com
Tue Jun 26 20:54:13 CEST 2012


Minor, but just stumbled over it ;-)

Christoph
-------------- next part --------------
commit 50ef00d4d14d620aac724a7a4a5b11fd57fca529
Author: Christoph Pfister <christophpfister at gmail.com>
Date:   Tue Jun 26 20:28:26 2012 +0200

    fix off-by-one error
    
    X_size is defined as sizeof(X) / sizeof(X[0]), so valid range is 0 .. X_size-1

diff --git a/lib/media_player.c b/lib/media_player.c
index b426637..cfd9f63 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1295,7 +1295,7 @@ void libvlc_media_player_navigate( libvlc_media_player_t* p_mi,
 {
     input_thread_t *p_input_thread;
 
-    if ( navigate > libvlc_navigate_to_action_size)
+    if ( navigate >= libvlc_navigate_to_action_size)
       return;
 
     p_input_thread = libvlc_get_input_thread ( p_mi );


More information about the vlc-devel mailing list