]> granicus.if.org Git - handbrake/commitdiff
json: fix potential crash when source file or title number doesn't exist
authorjstebbins <jstebbins.hb@gmail.com>
Tue, 7 Apr 2015 15:33:55 +0000 (15:33 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Tue, 7 Apr 2015 15:33:55 +0000 (15:33 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7064 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/hb_json.c

index f8d58f6837470fe45a800de85654cb48490099c3..882a3f76bd6a40d77142a19347c6a49a39d0a1f2 100644 (file)
@@ -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;