]> granicus.if.org Git - handbrake/commitdiff
Fixes encx264.c from rev 994 to avoid crasing with 2pass and auto select / forced...
authordynaflash <dynaflashtech@gmail.com>
Thu, 27 Sep 2007 16:15:55 +0000 (16:15 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Thu, 27 Sep 2007 16:15:55 +0000 (16:15 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@995 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/encx264.c

index a061cf1f30649f37fb75b9ff897a5288218cf21f..0de2e9f3b7df9b1d75814dee7f84d31aca245ee0 100644 (file)
@@ -97,9 +97,9 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
         Merritt implemented in the Mplayer/Mencoder project.
      */
 
-    char *x264opts = strdup(job->x264opts);
-    if( x264opts != NULL && *x264opts != '\0' )
+    if( job->x264opts != NULL && *job->x264opts != '\0' )
     {
+        char *x264opts = strdup(job->x264opts);
         while( *x264opts )
         {
             char *name = x264opts;
@@ -161,8 +161,8 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
             if( ret == X264_PARAM_BAD_VALUE )
                 hb_log( "x264 options: Bad argument %s=%s", name, value ? value : "(null)" );
         }
+        free(x264opts);
     }
-    free(x264opts);
 
 
     if( job->pixel_ratio )