From fbf7837f7cd3518ebb262a45f31768481761a016 Mon Sep 17 00:00:00 2001 From: van Date: Sun, 5 Apr 2009 03:55:12 +0000 Subject: Fix botched r2256 as suggested by forum user greed in post http://forum.handbrake.fr/viewtopic.php?f=4&t=9758&sid=b6deb84bf0f30e9dfa504e19d4c2d5c3&p=53722#p53722 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2301 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/dvd.c | 62 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'libhb') diff --git a/libhb/dvd.c b/libhb/dvd.c index 240d3bc2e..358cb552b 100644 --- a/libhb/dvd.c +++ b/libhb/dvd.c @@ -165,6 +165,37 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t ) goto fail; } + /* ignore titles with bogus cell addresses so we don't abort later + * in libdvdread. */ + for ( i = 0; i < vts->vts_c_adt->nr_of_vobs; ++i) + { + if( (vts->vts_c_adt->cell_adr_table[i].start_sector & 0xffffff ) == + 0xffffff ) + { + hb_error( "scan: cell_adr_table[%d].start_sector invalid (0x%x) " + "- skipping title", i, + vts->vts_c_adt->cell_adr_table[i].start_sector ); + goto fail; + } + if( (vts->vts_c_adt->cell_adr_table[i].last_sector & 0xffffff ) == + 0xffffff ) + { + hb_error( "scan: cell_adr_table[%d].last_sector invalid (0x%x) " + "- skipping title", i, + vts->vts_c_adt->cell_adr_table[i].last_sector ); + goto fail; + } + if( vts->vts_c_adt->cell_adr_table[i].start_sector >= + vts->vts_c_adt->cell_adr_table[i].last_sector ) + { + hb_error( "scan: cell_adr_table[%d].start_sector (0x%x) " + "is not before last_sector (0x%x) - skipping title", i, + vts->vts_c_adt->cell_adr_table[i].start_sector, + vts->vts_c_adt->cell_adr_table[i].last_sector ); + goto fail; + } + } + if( global_verbosity_level == 3 ) { ifoPrint( d->reader, title->vts ); @@ -235,37 +266,6 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t ) goto fail; } - /* ignore titles with bogus cell addresses so we don't abort later - * in libdvdread. */ - for ( i = 0; i < vts->vts_c_adt->nr_of_vobs; ++i) - { - if( (vts->vts_c_adt->cell_adr_table[i].start_sector & 0xffffff ) == - 0xffffff ) - { - hb_error( "scan: cell_adr_table[%d].start_sector invalid (0x%x) " - "- skipping title", i, - vts->vts_c_adt->cell_adr_table[i].start_sector ); - goto fail; - } - if( (vts->vts_c_adt->cell_adr_table[i].last_sector & 0xffffff ) == - 0xffffff ) - { - hb_error( "scan: cell_adr_table[%d].last_sector invalid (0x%x) " - "- skipping title", i, - vts->vts_c_adt->cell_adr_table[i].last_sector ); - goto fail; - } - if( vts->vts_c_adt->cell_adr_table[i].start_sector >= - vts->vts_c_adt->cell_adr_table[i].last_sector ) - { - hb_error( "scan: cell_adr_table[%d].start_sector (0x%x) " - "is not before last_sector (0x%x) - skipping title", i, - vts->vts_c_adt->cell_adr_table[i].start_sector, - vts->vts_c_adt->cell_adr_table[i].last_sector ); - goto fail; - } - } - /* Detect languages */ for( i = 0; i < vts->vtsi_mat->nr_of_vts_audio_streams; i++ ) { -- cgit v1.2.3