[vlc-commits] VCD: fix sign comparison error

Jean-Baptiste Kempf git at videolan.org
Thu Feb 17 22:28:10 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Feb 17 21:27:55 2011 +0100| [5adde00c30e6f1759ae589d0442d7161e02124dc] | committer: Jean-Baptiste Kempf

VCD: fix sign comparison error

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

 modules/access/vcd/vcd.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/access/vcd/vcd.c b/modules/access/vcd/vcd.c
index 813869f..925a894 100644
--- a/modules/access/vcd/vcd.c
+++ b/modules/access/vcd/vcd.c
@@ -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 )



More information about the vlc-commits mailing list