Fix uninitialized variable
authorAnton Mitrofanov <BugMaster@narod.ru>
Wed, 13 Nov 2013 15:24:48 +0000 (19:24 +0400)
committerJason Garrett-Glaser <jason@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 0ed1a7b..6cd8213 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;