summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-06-06 21:54:56 +0000
committerjstebbins <[email protected]>2011-06-06 21:54:56 +0000
commit2e50209258e4fb103798e099945cb68ac71c97c2 (patch)
treef9270748941c234ee86db3b2cbcffceac6f4733e
parentbad856916a1b7d00e6a118fed9f7941e4602c155 (diff)
libhb: fix crash when x264 fails to initialize
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4025 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/encx264.c5
-rw-r--r--libhb/work.c2
2 files changed, 6 insertions, 1 deletions
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( &param );
+ 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 )
{