summaryrefslogtreecommitdiffstats
path: root/libhb/bd.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-09-21 10:47:59 -0700
committerJohn Stebbins <[email protected]>2016-09-21 10:47:59 -0700
commitda6943835b433e52ac9001c1b1daff5ad2630a0c (patch)
tree14e81fe7b8a10ca987bef31e03104971be6e8e93 /libhb/bd.c
parentcb4dc1d1837603fd9ede3b462fbe7211353b9c15 (diff)
bd: fix crash when invalid title specified
fixes https://github.com/HandBrake/HandBrake/issues/272
Diffstat (limited to 'libhb/bd.c')
-rw-r--r--libhb/bd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libhb/bd.c b/libhb/bd.c
index e5fb6e83d..463586c67 100644
--- a/libhb/bd.c
+++ b/libhb/bd.c
@@ -286,7 +286,10 @@ hb_title_t * hb_bd_title_scan( hb_bd_t * d, int tt, uint64_t min_duration )
title->vts = 0;
title->ttn = 0;
- ti = d->title_info[tt - 1];
+ if (tt <= d->title_count)
+ {
+ ti = d->title_info[tt - 1];
+ }
if ( ti == NULL )
{
hb_log( "bd: invalid title" );