]> git.sesse.net Git - vlc/commitdiff
VCD: fix sign comparison error
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 17 Feb 2011 20:27:55 +0000 (21:27 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 17 Feb 2011 21:28:06 +0000 (22:28 +0100)
modules/access/vcd/vcd.c

index 813869f1ddd538e03827376a8fbc3ad9121c2ec8..925a8947431eab2d09d2137414bdc740233c8cfa 100644 (file)
@@ -389,7 +389,8 @@ static block_t *Block( access_t *p_access )
 
         if( t->i_seekpoint > 0 &&
             p_access->info.i_seekpoint + 1 < t->i_seekpoint &&
-            p_access->info.i_pos + i_read * VCD_DATA_SIZE >=
+            (int64_t) /* Unlikely to go over 8192 PetaB */
+                (p_access->info.i_pos + i_read * VCD_DATA_SIZE) >=
             t->seekpoint[p_access->info.i_seekpoint+1]->i_byte_offset )
         {
             msg_Dbg( p_access, "seekpoint change" );
@@ -423,7 +424,8 @@ static int Seek( access_t *p_access, uint64_t i_pos )
     for( i_seekpoint = 0; i_seekpoint < t->i_seekpoint; i_seekpoint++ )
     {
         if( i_seekpoint + 1 >= t->i_seekpoint ) break;
-        if( i_pos < t->seekpoint[i_seekpoint + 1]->i_byte_offset ) break;
+        if( 0 < t->seekpoint[i_seekpoint + 1]->i_byte_offset &&
+            i_pos < (uint64_t)t->seekpoint[i_seekpoint + 1]->i_byte_offset ) break;
     }
 
     if( i_seekpoint != p_access->info.i_seekpoint )