Mercurial > libdvdnav.hg
changeset 302:ef017423e37c src
since sectors range in [0..len-1] the target offset must be validated not to exceed length-1; reported by ggurov@abv.bg
author | nicodvb |
---|---|
date | Wed, 11 Jul 2007 21:53:36 +0000 |
parents | 4e24652c5ddf |
children | 52cda7471a24 |
files | searching.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/searching.c Wed Jul 11 21:21:45 2007 +0000 +++ b/searching.c Wed Jul 11 21:53:36 2007 +0000 @@ -227,7 +227,7 @@ 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 @@ 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;