[libdvdnav-devel] libdvdread: ifoRead functions need proper error handling

Steve Dibb beandog at gentoo.org
Fri Jan 9 07:44:21 CET 2015

The next major issue I wanna tackle re the libdvdread bugs is fixing
ifoRead*() functions.  The problem is really simple: the code runs
CHECK_VALUE() all over the place, but doesn't actually quit when it
hits a value that is going to break reading the IFO.

The whole thing is a mess, with a lot of different scenarios.

For example, there are some variables that it doesn't matter what
they're set to, since they're not used anywhere else when looking at
the data.  The value checks can be removed, or ignored.  zero* ones are
an example.

Another is that there's a lot of variables where the original code just
guesses at what are some sane values (nr_of_lus), but doesn't actually
do anything if it's out of bounds or not.

A lot of them are just simple checks to see if the sectors are actually
in sequential order.

Last of all, there's some value checks that are just commented out, or
flagged as ?? in the code, with no documentation present.

The good thing is that we have enough sane checks that we can run,
where we have specs or obvious answers to guide us, that will fix a lot
of issues.  In each case, it's really simple design -- if something
breaks, then just stop trying to read the IFO and it'll be ignored, and
considered garbage.  That's it.  Super easy.  It just needs to be
cleaned up, which I totally don't mind doing, but I want to wait to see
how my previous patches get applied so I don't dig myself into a
further hole trying to manage git branches.


More information about the libdvdnav-devel mailing list