[DVDnav-discuss] r944 - trunk/libdvdnav/src/searching.c
nicodvb
subversion at mplayerhq.hu
Wed Jul 11 23:53:36 CEST 2007
Author: nicodvb
Date: Wed Jul 11 23:53:36 2007
New Revision: 944
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/libdvdnav/src/searching.c
Modified: trunk/libdvdnav/src/searching.c
==============================================================================
--- trunk/libdvdnav/src/searching.c (original)
+++ trunk/libdvdnav/src/searching.c Wed Jul 11 23:53:36 2007
@@ -227,7 +227,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;
@@ -235,7 +235,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