Commit a6c396f0 authored by Anton Mitrofanov's avatar Anton Mitrofanov Committed by Fiona Glaser

Fix a few minor bugs found with a static analyzer

parent 2d66c7c2
......@@ -342,7 +342,7 @@ static int x264_param_apply_tune( x264_param_t *param, const char *tune )
param->analyse.i_luma_deadzone[1] = 6;
param->rc.f_qcompress = 0.8;
}
else if( !strncasecmp( s, "stillimage", 5 ) )
else if( !strncasecmp( s, "stillimage", 10 ) )
{
if( psy_tuning_used++ ) goto psy_failure;
param->i_deblocking_filter_alphac0 = -3;
......
......@@ -119,7 +119,7 @@ static int x264_detect_switchable_graphics( void );
/* Try to load the cached compiled program binary, verify the device context is
* still valid before reuse */
static cl_program x264_opencl_cache_load( x264_t *h, char *dev_name, char *dev_vendor, char *driver_version )
static cl_program x264_opencl_cache_load( x264_t *h, const char *dev_name, const char *dev_vendor, const char *driver_version )
{
/* try to load cached program binary */
FILE *fp = fopen( h->param.psz_clbin_file, "rb" );
......@@ -167,7 +167,7 @@ fail:
/* Save the compiled program binary to a file for later reuse. Device context
* is also saved in the cache file so we do not reuse stale binaries */
static void x264_opencl_cache_save( x264_t *h, cl_program program, char *dev_name, char *dev_vendor, char *driver_version )
static void x264_opencl_cache_save( x264_t *h, cl_program program, const char *dev_name, const char *dev_vendor, const char *driver_version )
{
FILE *fp = fopen( h->param.psz_clbin_file, "wb" );
if( !fp )
......@@ -685,7 +685,7 @@ static int x264_detect_switchable_graphics( void )
ADL_Main_Control_Destroy = (ADL_MAIN_CONTROL_DESTROY)adl_address(hDLL, "ADL_Main_Control_Destroy");
ADL_Adapter_NumberOfAdapters_Get = (ADL_ADAPTER_NUMBEROFADAPTERS_GET)adl_address(hDLL, "ADL_Adapter_NumberOfAdapters_Get");
ADL_PowerXpress_Scheme_Get = (ADL_POWERXPRESS_SCHEME_GET)adl_address(hDLL, "ADL_PowerXpress_Scheme_Get");
if( !ADL_Main_Control_Destroy || !ADL_Main_Control_Destroy || !ADL_Adapter_NumberOfAdapters_Get ||
if( !ADL_Main_Control_Create || !ADL_Main_Control_Destroy || !ADL_Adapter_NumberOfAdapters_Get ||
!ADL_PowerXpress_Scheme_Get )
goto fail1;
......
......@@ -2719,7 +2719,7 @@ static int find_underflow( x264_t *h, double *fills, int *t0, int *t1, int over
* we're adding or removing bits), and starting on the earliest frame that
* can influence the buffer fill of that end frame. */
x264_ratecontrol_t *rcc = h->rc;
const double buffer_min = (over ? .1 : .1) * rcc->buffer_size;
const double buffer_min = .1 * rcc->buffer_size;
const double buffer_max = .9 * rcc->buffer_size;
double fill = fills[*t0-1];
double parity = over ? 1. : -1.;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment