diff --git a/README.md b/README.md index b4131068c0..6a11fa6763 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ Clang build: Clang static analysis: - $ scan-build ./configure --disable-introspection + $ scan-build ./configure --disable-introspection --disable-debug $ scan-build -o scan -v make $ scan-view scan/2013-11-22-2 diff --git a/libvips/colour/LCh2Lab.c b/libvips/colour/LCh2Lab.c index deec3827c4..8e257b7263 100644 --- a/libvips/colour/LCh2Lab.c +++ b/libvips/colour/LCh2Lab.c @@ -102,6 +102,11 @@ vips_col_Ch2ab( float C, float h, float *a, float *b ) float out[3]; float *x; + /* could be anything, we don't use this value, but we must supply one + * or static analyzers will complain. + */ + in[0] = 50.0; + in[1] = C; in[2] = h; x = &in[0]; diff --git a/libvips/conversion/smartcrop.c b/libvips/conversion/smartcrop.c index caddf77183..6936cc650d 100644 --- a/libvips/conversion/smartcrop.c +++ b/libvips/conversion/smartcrop.c @@ -286,6 +286,8 @@ vips_smartcrop_build( VipsObject *object ) switch( smartcrop->interesting ) { case VIPS_INTERESTING_NONE: + left = 0; + top = 0; break; case VIPS_INTERESTING_CENTRE: diff --git a/libvips/convolution/convi.c b/libvips/convolution/convi.c index b7c6845ca9..b3c852a12b 100644 --- a/libvips/convolution/convi.c +++ b/libvips/convolution/convi.c @@ -932,6 +932,10 @@ vips_convi_build( VipsObject *object ) return( -1 ); in = t[0]; + /* Default to the C path. + */ + generate = vips_convi_gen; + /* For uchar input, try to make a vector path. */ if( vips_vector_isenabled() && @@ -946,9 +950,11 @@ vips_convi_build( VipsObject *object ) vips_convi_compile_free( convi ); } - /* If there's no vector path, fall back to C. + /* Make the data for the C path. */ - if( !convi->n_pass ) { + if( generate == vips_convi_gen ) { + g_info( "using C path" ); + /* Make an int version of our mask. */ if( vips__image_intize( M, &t[1] ) ) @@ -977,9 +983,6 @@ vips_convi_build( VipsObject *object ) convi->coeff_pos[0] = 0; convi->nnz = 1; } - - generate = vips_convi_gen; - g_info( "using C path" ); } g_object_set( convi, "out", vips_image_new(), NULL ); diff --git a/libvips/convolution/convsep.c b/libvips/convolution/convsep.c index d428e73453..3ae4fbf19a 100644 --- a/libvips/convolution/convsep.c +++ b/libvips/convolution/convsep.c @@ -76,7 +76,7 @@ vips_convsep_build( VipsObject *object ) in = convolution->in; if( convsep->precision == VIPS_PRECISION_APPROXIMATE ) { - if( vips_convasep( convolution->in, &t[0], convolution->M, + if( vips_convasep( in, &t[0], convolution->M, "layers", convsep->layers, NULL ) ) return( -1 ); @@ -90,7 +90,7 @@ vips_convsep_build( VipsObject *object ) */ vips_image_set_double( t[0], "offset", 0 ); - if( vips_conv( convolution->in, &t[1], convolution->M, + if( vips_conv( in, &t[1], convolution->M, "precision", convsep->precision, "layers", convsep->layers, "cluster", convsep->cluster, diff --git a/libvips/foreign/tiff2vips.c b/libvips/foreign/tiff2vips.c index 72053bad74..87b187d9c7 100644 --- a/libvips/foreign/tiff2vips.c +++ b/libvips/foreign/tiff2vips.c @@ -1462,6 +1462,11 @@ rtiff_fill_region( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop while( y < r->height ) { VipsRect tile, page, hit; + /* Not necessary, but it stops static analyzers complaining + * about a used-before-set. + */ + tile.height = 0; + x = 0; while( x < r->width ) { int page_no = rtiff->page + (r->top + y) / diff --git a/libvips/iofuncs/buffer.c b/libvips/iofuncs/buffer.c index e752d6da89..87efa49f41 100644 --- a/libvips/iofuncs/buffer.c +++ b/libvips/iofuncs/buffer.c @@ -507,6 +507,7 @@ vips_buffer_new( VipsImage *im, VipsRect *area ) g_assert( buffer->cache ); buffer->ref_count = 1; + buffer->done = FALSE; buffer->cache = NULL; } else {