diff options
author | van <[email protected]> | 2008-03-02 05:15:56 +0000 |
---|---|---|
committer | van <[email protected]> | 2008-03-02 05:15:56 +0000 |
commit | 51a12d1cd4a2198b3d8e5ae0b339ed901522e5a3 (patch) | |
tree | acd1ea208cf5cd883c3d7e3ce33ba1535f833c18 /libhb/dvd.c | |
parent | 42facae34c60ad9b84b8c88d91f0daabf8a5d335 (diff) |
Don't crash just because some dvd title uses an illegal pgn number.
(Fixes bug reported in http://forum.handbrake.fr/viewtopic.php?p=28767&sid=23308d0c02b70fceb54db71b0d0f2660#p28767).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1324 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/dvd.c')
-rw-r--r-- | libhb/dvd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c index 05e9bde57..1c4eb60d3 100644 --- a/libhb/dvd.c +++ b/libhb/dvd.c @@ -178,6 +178,12 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t ) goto fail; } + if( pgn <= 0 || pgn > 99 ) + { + hb_error( "scan: pgn %d not valid, skipping", pgn ); + goto fail; + } + /* Start cell */ title->cell_start = d->pgc->program_map[pgn-1] - 1; title->block_start = d->pgc->cell_playback[title->cell_start].first_sector; |