summaryrefslogtreecommitdiffstats
path: root/libhb/dvd.c
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2007-11-19 17:41:47 +0000
committerjbrjake <[email protected]>2007-11-19 17:41:47 +0000
commitca6b1dbdf7a7249f8d9ea00cdfe4681a05ade2fa (patch)
tree91d40490a0193c462c4bc765977bd2e4e5339461 /libhb/dvd.c
parentf86a4bb4acdd434bd77bd05de577ad6d85e3df9e (diff)
Exit gracefully when trying to ifoOpen a title with no VTS entry, instead of crashing with a bus error.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1069 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/dvd.c')
-rw-r--r--libhb/dvd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c
index 449bdd4fb..94f020fca 100644
--- a/libhb/dvd.c
+++ b/libhb/dvd.c
@@ -146,6 +146,13 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
/* VTS which our title is in */
title->vts = d->vmg->tt_srpt->title[t-1].title_set_nr;
+ if ( !title->vts )
+ {
+ /* A VTS of 0 means the title wasn't found in the title set */
+ hb_error("Invalid VTS (title set) number: %i", title->vts);
+ goto fail;
+ }
+
hb_log( "scan: opening IFO for VTS %d", title->vts );
if( !( vts = ifoOpen( d->reader, title->vts ) ) )
{