]> git.sesse.net Git - x264/commitdiff
Fix uninitialized variable
authorAnton Mitrofanov <BugMaster@narod.ru>
Wed, 13 Nov 2013 15:24:48 +0000 (19:24 +0400)
committerFiona Glaser <fiona@x264.com>
Mon, 6 Jan 2014 20:15:32 +0000 (12:15 -0800)
Caused if the timebase is not specified in stats file. Found by Clang.

encoder/ratecontrol.c

index 9529413f5ac3e0144a0b8dcb70251b54bce20698..641c93eb02142bfba6075fcd1a7f377c8ee90ace 100644 (file)
@@ -911,7 +911,7 @@ int x264_ratecontrol_new( x264_t *h )
              * so we'll at least try to roughly approximate this effect. */
             res_factor_bits = powf( res_factor, 0.7 );
 
-            if( ( p = strstr( opts, "timebase=" ) ) && sscanf( p, "timebase=%u/%u", &k, &l ) != 2 )
+            if( !( p = strstr( opts, "timebase=" ) ) || sscanf( p, "timebase=%u/%u", &k, &l ) != 2 )
             {
                 x264_log( h, X264_LOG_ERROR, "timebase specified in stats file not valid\n" );
                 return -1;