[DVDnav-discuss] dvdnav_sector_search() bugs

Gospodin Gyurov ggurov at abv.bg
Wed Jul 11 17:07:36 CEST 2007


Hi,
there are some bugs in the function dvdnav_sector_search (file searching.cpp). I mean error checks in switch(origin). Correct checks are:

case SEEK_SET:
    if(offset >= length) {  // not just '=', the last sector number is equal to length - 1, numbers start from zero
...
case SEEK_CUR:
    if(target + offset >= length) {  // the same problem
...
case SEEK_END:
    if(length < offset) {  // the old code is length - offset < 0, but both values are unsigned !

I think also 'offset' have to be of type uint32_t, no need of uint64_t. Especially when dvdnav_get_position() returns uint32_t as now.

-----------------------------------------------------------------
С бензин в кръвта!
http://auto-motor-und-sport.bg/



More information about the DVDnav-discuss mailing list