# HG changeset patch # User jcdutton # Date 1030791061 0 # Node ID 5716523464dda3e88cd20e438a1853e7e172032d # Parent 033f011d81520e130afebe5008b99bc0310474b5 Handle badly written DVDs better. If a Cell has a Cell command pointer, but the PGC Cell command list does not have an entry for it, assume that the cell has no cell commands and continue instead of assert(). diff -r 033f011d8152 -r 5716523464dd vm.c --- a/vm.c Sat Aug 31 02:50:27 2002 +0000 +++ b/vm.c Sat Aug 31 10:51:01 2002 +0000 @@ -1054,10 +1054,15 @@ if(cell->cell_cmd_nr != 0) { link_t link_values; -#ifdef STRICT - assert((vm->state).pgc->command_tbl != NULL); - assert((vm->state).pgc->command_tbl->nr_of_cell >= cell->cell_cmd_nr); -#endif +/* These asserts are now not needed. + * Some DVDs have no cell commands listed in the PGC, + * but the Cell itself points to a cell command that does not exist. + * For this situation, just ignore the cell command and continue. + * + * assert((vm->state).pgc->command_tbl != NULL); + * assert((vm->state).pgc->command_tbl->nr_of_cell >= cell->cell_cmd_nr); + */ + if ((vm->state).pgc->command_tbl != NULL && (vm->state).pgc->command_tbl->nr_of_cell >= cell->cell_cmd_nr) { #ifdef TRACE @@ -1072,6 +1077,7 @@ } } else { fprintf(MSG_OUT, "libdvdnav: Invalid Cell command\n"); + } } @@ -1826,6 +1832,12 @@ /* * $Log$ + * Revision 1.30 2002/08/31 10:51:01 jcdutton + * Handle badly written DVDs better. + * If a Cell has a Cell command pointer, but the PGC Cell command list does not have an + * entry for it, assume that the cell has no cell commands and continue instead of + * assert(). + * * Revision 1.29 2002/08/31 02:50:27 jcdutton * Improve some debug messages. * Add some comments about dvdnav_open memory leaks.