From: Anton Mitrofanov Date: Wed, 13 Nov 2013 15:24:48 +0000 (+0400) Subject: Fix uninitialized variable X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2f5d600bf866899db92e2dae40eb9fe46d44ade;p=libx264 Fix uninitialized variable Caused if the timebase is not specified in stats file. Found by Clang. --- diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index 9529413f..641c93eb 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -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;