summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-04-07 15:33:55 +0000
committerjstebbins <[email protected]>2015-04-07 15:33:55 +0000
commit3f537cb97206f609c62867b32f262dd716b8df31 (patch)
tree1ec45574552b499dc192e06d100908de52ca9d01 /libhb
parentd030ab8b629ebd577ca845c4e77f9b7ef73dc936 (diff)
json: fix potential crash when source file or title number doesn't exist
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7064 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/hb_json.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libhb/hb_json.c b/libhb/hb_json.c
index f8d58f683..882a3f76b 100644
--- a/libhb/hb_json.c
+++ b/libhb/hb_json.c
@@ -801,6 +801,11 @@ hb_job_t* hb_dict_to_job( hb_handle_t * h, hb_dict_t *dict )
}
job = hb_job_init_by_index(h, titleindex);
+ if (job == NULL)
+ {
+ hb_error("hb_dict_to_job: Title %d doesn't exist", titleindex);
+ return NULL;
+ }
hb_value_array_t *chapter_list = NULL;
hb_value_array_t *audio_list = NULL;