diff options
-rw-r--r-- | libhb/reader.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libhb/reader.c b/libhb/reader.c index 800b4caad..f7cab0e40 100644 --- a/libhb/reader.c +++ b/libhb/reader.c @@ -279,6 +279,13 @@ static int reader_init( hb_work_object_t * w, hb_job_t * job ) else { int count = hb_list_count(job->title->list_chapter); + + if (job->chapter_end > count || job->chapter_start > count || job->chapter_start > job->chapter_end) + { + hb_error("Invalid chapter start/end indexes"); + return 1; + } + if (count == 0 || count <= job->chapter_end) { r->duration = job->title->duration; |