From 5f97e53ffb4b822b92f2c67a064276fc06ec6a74 Mon Sep 17 00:00:00 2001 From: jbrjake Date: Mon, 19 Nov 2007 17:41:47 +0000 Subject: [PATCH] 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 --- libhb/dvd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libhb/dvd.c b/libhb/dvd.c index 449bdd4f..94f020fc 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 ) ) ) { -- 2.11.4.GIT