]> git.sesse.net Git - vlc/commitdiff
vdr: check array index before using it.
authorRémi Duraffort <ivoire@videolan.org>
Tue, 11 Oct 2011 14:20:54 +0000 (16:20 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 11 Nov 2011 11:52:56 +0000 (12:52 +0100)
modules/access/vdr.c

index cd5427b6788a98517f579b9f99bef83af34336b6..0a073307d2d6bb5916939dfab1ec0d0a6c90c046 100644 (file)
@@ -407,8 +407,8 @@ static int Seek( access_t *p_access, uint64_t i_pos )
 
     /* find correct file */
     unsigned i_file = 0;
-    while( i_pos >= FILE_SIZE( i_file ) &&
-        i_file < FILE_COUNT - 1 )
+    while( i_file < FILE_COUNT - 1 &&
+           i_pos >= FILE_SIZE( i_file ) )
     {
         i_pos -= FILE_SIZE( i_file );
         i_file++;