From 2b72244a459396efde16bd624e9b6a3807732ed1 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 17 Jan 2017 19:09:00 +0000 Subject: [PATCH] fix fitsload --- libvips/foreign/fits.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libvips/foreign/fits.c b/libvips/foreign/fits.c index bf25aa1e..a3ae6613 100644 --- a/libvips/foreign/fits.c +++ b/libvips/foreign/fits.c @@ -364,11 +364,16 @@ vips__fits_read_header( const char *filename, VipsImage *out ) static int vips_fits_read_subset( VipsFits *fits, - long fpixel[MAX_DIMENSIONS], long lpixel[MAX_DIMENSIONS], - long inc[MAX_DIMENSIONS], VipsPel *q ) + long *fpixel, long *lpixel, long *inc, VipsPel *q ) { int status; + /* We must zero this or fits_read_subset() fails. + */ + status = 0; + + /* Break on ffgsv() for this call. + */ if( fits_read_subset( fits->fptr, fits->datatype, fpixel, lpixel, inc, NULL, q, NULL, &status ) ) { @@ -422,8 +427,6 @@ fits2vips_generate( VipsRegion *out, q = VIPS_REGION_ADDR( out, r->left, r->top ); - /* Break on ffgsv() for this call. - */ g_mutex_lock( fits->lock ); if( vips_fits_read_subset( fits, fpixel, lpixel, inc, q ) ) { g_mutex_unlock( fits->lock ); @@ -452,8 +455,6 @@ fits2vips_generate( VipsRegion *out, q = VIPS_REGION_ADDR( out, r->left, y ); - /* Break on ffgsv() for this call. - */ g_mutex_lock( fits->lock ); if( vips_fits_read_subset( fits, fpixel, lpixel, inc, q ) ) {