Changeset 1317c0d


Ignore:
Timestamp:
03/11/09 05:11:02 (7 years ago)
Author:
van <vanj.hb@…>
Branches:
master
Children:
df05598
Parents:
37d5d86
Message:

Detect bogus cell start and last addresses while scanning each title so we don't crash later in dvdread. Fix from user "greed" in forum thread http://forum.handbrake.fr/viewtopic.php?f=4&t=9758&start=0

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2256 b64f7644-9d1e-0410-96f1-a4d463321fa5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libhb/dvd.c

    rf2910e7 r1317c0d  
    234234        hb_log( "scan: ignoring title (too short)" );
    235235        goto fail;
     236    }
     237
     238    /* ignore titles with bogus cell addresses so we don't abort later
     239     * in libdvdread. */
     240    for ( i = 0; i < vts->vts_c_adt->nr_of_vobs; ++i)
     241    {
     242        if( (vts->vts_c_adt->cell_adr_table[i].start_sector & 0xffffff ) ==
     243            0xffffff )
     244        {
     245            hb_error( "scan: cell_adr_table[%d].start_sector invalid (0x%x) "
     246                      "- skipping title", i,
     247                      vts->vts_c_adt->cell_adr_table[i].start_sector );
     248            goto fail;
     249        }
     250        if( (vts->vts_c_adt->cell_adr_table[i].last_sector & 0xffffff ) ==
     251            0xffffff )
     252        {
     253            hb_error( "scan: cell_adr_table[%d].last_sector invalid (0x%x) "
     254                      "- skipping title", i,
     255                      vts->vts_c_adt->cell_adr_table[i].last_sector );
     256            goto fail;
     257        }
     258        if( vts->vts_c_adt->cell_adr_table[i].start_sector >=
     259            vts->vts_c_adt->cell_adr_table[i].last_sector )
     260        {
     261            hb_error( "scan: cell_adr_table[%d].start_sector (0x%x) "
     262                      "is not before last_sector (0x%x) - skipping title", i,
     263                      vts->vts_c_adt->cell_adr_table[i].start_sector,
     264                      vts->vts_c_adt->cell_adr_table[i].last_sector );
     265            goto fail;
     266        }
    236267    }
    237268
Note: See TracChangeset for help on using the changeset viewer.