summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvan <[email protected]>2009-04-05 03:55:12 +0000
committervan <[email protected]>2009-04-05 03:55:12 +0000
commitfbf7837f7cd3518ebb262a45f31768481761a016 (patch)
treef1434290b9c38cec9a6ca550797e799d41b0a9c7
parentd6173f9832f42d2786edafb45f4c75926b5da8e0 (diff)
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
-rw-r--r--libhb/dvd.c62
1 files changed, 31 insertions, 31 deletions
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++ )
{