[DVDnav-discuss] dvdnav_sector_search() bugs
Nico Sabbi
nicola_sabbi at fastwebnet.it
Wed Jul 11 23:55:02 CEST 2007
Gospodin Gyurov wrote:
> 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 !
both applied, thanks.
>
> 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.
>
yes, but this would break api for a very minor nitpick
More information about the DVDnav-discuss
mailing list