From: Anton Mitrofanov Date: Wed, 13 Nov 2013 15:24:48 +0000 (+0400) Subject: Fix uninitialized variable X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=d2ed48ce17df83af8e5e1d35d1b922c9e1726006;p=x264.git 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 0ed1a7bc..6cd8213b 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;