fix another tiny ref leak
This commit is contained in:
parent
73f8263286
commit
cbe0dcf797
@ -67,10 +67,14 @@ im__value( IMAGE *im, double *value )
|
|||||||
{
|
{
|
||||||
IMAGE *t;
|
IMAGE *t;
|
||||||
|
|
||||||
if( !(t = im_open_local( im, "im__value", "p" )) ||
|
if( !(t = im_open( "im__value", "p" )) )
|
||||||
im_extract_areabands( im, t, 0, 0, 1, 1, 0, 1 ) ||
|
|
||||||
im_avg( t, value ) )
|
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
if( im_extract_areabands( im, t, 0, 0, 1, 1, 0, 1 ) ||
|
||||||
|
im_avg( t, value ) ) {
|
||||||
|
im_close( t );
|
||||||
|
return( -1 );
|
||||||
|
}
|
||||||
|
im_close( t );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@ int
|
|||||||
im_point( IMAGE *im, VipsInterpolate *interpolate,
|
im_point( IMAGE *im, VipsInterpolate *interpolate,
|
||||||
double x, double y, int band, double *out )
|
double x, double y, int band, double *out )
|
||||||
{
|
{
|
||||||
|
IMAGE *mem;
|
||||||
IMAGE *t[2];
|
IMAGE *t[2];
|
||||||
|
|
||||||
if( band >= im->Bands ||
|
if( band >= im->Bands ||
|
||||||
@ -75,15 +76,20 @@ im_point( IMAGE *im, VipsInterpolate *interpolate,
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( im_open_local_array( im, t, 2, "im_point_bilinear", "p" ) ||
|
if( !(mem = im_open( "im_point", "p" )) )
|
||||||
|
return( -1 );
|
||||||
|
if( im_open_local_array( mem, t, 2, "im_point", "p" ) ||
|
||||||
im_extract_band( im, t[0], band ) ||
|
im_extract_band( im, t[0], band ) ||
|
||||||
im_affinei( t[0], t[1],
|
im_affinei( t[0], t[1],
|
||||||
interpolate,
|
interpolate,
|
||||||
1, 0, 0, 1,
|
1, 0, 0, 1,
|
||||||
x - floor( x ), y - floor( y ),
|
x - floor( x ), y - floor( y ),
|
||||||
floor( x ), floor( y ), 1, 1 ) ||
|
floor( x ), floor( y ), 1, 1 ) ||
|
||||||
im_avg( t[1], out ) )
|
im_avg( t[1], out ) ) {
|
||||||
|
im_close( mem );
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
}
|
||||||
|
im_close( mem );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
@ -223,6 +223,9 @@ vips__vector_to_ink( const char *domain, VipsImage *im, double *vec, int n )
|
|||||||
if( vips_check_vector( domain, n, im ) )
|
if( vips_check_vector( domain, n, im ) )
|
||||||
return( NULL );
|
return( NULL );
|
||||||
|
|
||||||
|
/* This looks a bit dodgy, but the pipeline we are creating does not
|
||||||
|
* depend upon im, so it's OK to make t depend on im.
|
||||||
|
*/
|
||||||
t = (VipsImage **) vips_object_local_array( VIPS_OBJECT( im ), 4 );
|
t = (VipsImage **) vips_object_local_array( VIPS_OBJECT( im ), 4 );
|
||||||
ones = VIPS_ARRAY( im, n, double );
|
ones = VIPS_ARRAY( im, n, double );
|
||||||
for( i = 0; i < n; i++ )
|
for( i = 0; i < n; i++ )
|
||||||
|
Loading…
Reference in New Issue
Block a user