[DVDnav-discuss] r943 - trunk/libdvdnav2/src/searching.c

nicodvb subversion at mplayerhq.hu
Wed Jul 11 23:52:56 CEST 2007


Author: nicodvb
Date: Wed Jul 11 23:52:56 2007
New Revision: 943

Log:
since sectors range in [0..len-1] the target offset must be validated not to exceed length-1; reported by ggurov at abv.bg

Modified:
   trunk/libdvdnav2/src/searching.c

Modified: trunk/libdvdnav2/src/searching.c
==============================================================================
--- trunk/libdvdnav2/src/searching.c	(original)
+++ trunk/libdvdnav2/src/searching.c	Wed Jul 11 23:52:56 2007
@@ -210,7 +210,7 @@ dvdnav_status_t dvdnav_sector_search(dvd
 
   switch(origin) {
    case SEEK_SET:
-    if(offset > length) {
+    if(offset >= length) {
       printerr("Request to seek behind end.");
       pthread_mutex_unlock(&this->vm_lock);
       return DVDNAV_STATUS_ERR;
@@ -218,7 +218,7 @@ dvdnav_status_t dvdnav_sector_search(dvd
     target = offset;
     break;
    case SEEK_CUR:
-    if(target + offset > length) {
+    if(target + offset >= length) {
       printerr("Request to seek behind end.");
       pthread_mutex_unlock(&this->vm_lock);
       return DVDNAV_STATUS_ERR;



More information about the DVDnav-discuss mailing list