]> granicus.if.org Git - handbrake/commitdiff
bd: fix crash when invalid title specified
authorJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 21 Sep 2016 17:47:59 +0000 (10:47 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 21 Sep 2016 17:47:59 +0000 (10:47 -0700)
fixes https://github.com/HandBrake/HandBrake/issues/272

libhb/bd.c

index e5fb6e83d83eca393f0e0b424e21b55e9391a688..463586c67c2d97ed70e803a731c68ff3639b05aa 100644 (file)
@@ -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" );