From c5a7db6eb6a4bb642024528a0b4e8678347c6331 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 10 Dec 2017 20:03:58 +0000 Subject: [PATCH] tiny cleanup --- libvips/iofuncs/region.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libvips/iofuncs/region.c b/libvips/iofuncs/region.c index c136e874..98211ff4 100644 --- a/libvips/iofuncs/region.c +++ b/libvips/iofuncs/region.c @@ -659,11 +659,11 @@ vips_region_image( VipsRegion *reg, const VipsRect *r ) } reg->invalid = FALSE; + VIPS_FREEF( vips_buffer_unref, reg->buffer ); if( image->data ) { /* We have the whole image available ... easy! */ - VIPS_FREEF( vips_buffer_unref, reg->buffer ); VIPS_FREEF( vips_window_unref, reg->window ); /* We can't just set valid = whole image, since this may be an @@ -675,8 +675,6 @@ vips_region_image( VipsRegion *reg, const VipsRect *r ) reg->type = VIPS_REGION_OTHER_IMAGE; } else if( image->dtype == VIPS_IMAGE_OPENIN ) { - VIPS_FREEF( vips_buffer_unref, reg->buffer ); - /* No complete image data ... but we can use a rolling window. */ reg->type = VIPS_REGION_WINDOW; @@ -694,7 +692,6 @@ vips_region_image( VipsRegion *reg, const VipsRect *r ) reg->data = reg->window->data; } else { - VIPS_FREEF( vips_buffer_unref, reg->buffer ); VIPS_FREEF( vips_window_unref, reg->window ); vips_error( "VipsRegion", "%s", _( "bad image type" ) );