From 2e50209258e4fb103798e099945cb68ac71c97c2 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Mon, 6 Jun 2011 21:54:56 +0000 Subject: libhb: fix crash when x264 fails to initialize git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4025 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/encx264.c | 5 +++++ libhb/work.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libhb/encx264.c b/libhb/encx264.c index cc45cef79..350b3a76c 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -296,6 +296,11 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) hb_deep_log( 2, "encx264: opening libx264 (pass %d)", job->pass ); pv->x264 = x264_encoder_open( ¶m ); + if ( pv->x264 == NULL ) + { + hb_error("encx264: x264_encoder_open failed."); + return 1; + } x264_encoder_headers( pv->x264, &nal, &nal_count ); diff --git a/libhb/work.c b/libhb/work.c index eac0c0ad7..f1db58b81 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -1232,7 +1232,7 @@ cleanup: static void work_loop( void * _w ) { hb_work_object_t * w = _w; - hb_buffer_t * buf_in, * buf_out; + hb_buffer_t * buf_in = NULL, * buf_out = NULL; while( !*w->done && w->status != HB_WORK_DONE ) { -- cgit v1.2.3