summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-03-11 14:42:33 +0000
committerjstebbins <[email protected]>2015-03-11 14:42:33 +0000
commit842f2ec78e8d64957db8ee3d7e7ada7d9e133487 (patch)
tree4453666a1f4d9eec16650c9574c55889d1d11885 /libhb
parent5659591f18115c3eeeb94717395148a38cb7a806 (diff)
json: fix crash when foreign audio search is *not* enabled
Also, prevent crashes that occur when the json is not properly parsed. It will still fail to encode, but we will capture the parse failure in the log. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6983 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/hb_json.c2
-rw-r--r--libhb/work.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/libhb/hb_json.c b/libhb/hb_json.c
index 8020221d1..0ee09f77b 100644
--- a/libhb/hb_json.c
+++ b/libhb/hb_json.c
@@ -766,7 +766,7 @@ hb_job_t* hb_json_to_job( hb_handle_t * h, const char * json_job )
// Audio {CopyMask, FallbackEncoder}
"s?{s?i, s?i},"
// Subtitle {Search {Enable, Forced, Default, Burn}}
- "s?{s?{s:b, s?b, s?b, s?b}},"
+ "s?{s?{s?b, s?b, s?b, s?b}},"
// MetaData {Name, Artist, Composer, AlbumArtist, ReleaseDate,
// Comment, Genre, Description, LongDescription}
"s?{s?s, s?s, s?s, s?s, s?s, s?s, s?s, s?s, s?s},"
diff --git a/libhb/work.c b/libhb/work.c
index 01060c01f..b3d0744d7 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -106,6 +106,13 @@ static void work_func( void * _work )
// Expand json string to full job struct
hb_job_t *new_job = hb_json_to_job(job->h, job->json);
+ if (new_job == NULL)
+ {
+ hb_job_close(&job);
+ hb_list_close(&passes);
+ *work->die = 1;
+ break;
+ }
new_job->h = job->h;
hb_job_close(&job);
job = new_job;