diff --git a/libvips/iofuncs/reorder.c b/libvips/iofuncs/reorder.c index 2333359a..bf3f1050 100644 --- a/libvips/iofuncs/reorder.c +++ b/libvips/iofuncs/reorder.c @@ -114,11 +114,6 @@ vips_reorder_print( VipsReorder *reorder ) static void vips_reorder_destroy( VipsReorder *reorder ) { - VIPS_FREE( reorder->input ); - VIPS_FREE( reorder->score ); - VIPS_FREE( reorder->recomp_order ); - VIPS_FREE( reorder->source ); - VIPS_FREE( reorder->cumulative_margin ); VIPS_FREE( reorder ); } @@ -196,9 +191,9 @@ vips__reorder_set_input( VipsImage *image, VipsImage **in ) for( i = 0; in[i]; i++ ) ; reorder->n_inputs = i; - reorder->input = VIPS_ARRAY( NULL, reorder->n_inputs + 1, VipsImage * ); - reorder->score = VIPS_ARRAY( NULL, reorder->n_inputs, int ); - reorder->recomp_order = VIPS_ARRAY( NULL, reorder->n_inputs, int ); + reorder->input = VIPS_ARRAY( image, reorder->n_inputs + 1, VipsImage * ); + reorder->score = VIPS_ARRAY( image, reorder->n_inputs, int ); + reorder->recomp_order = VIPS_ARRAY( image, reorder->n_inputs, int ); if( !reorder->input ) return( -1 ); if( reorder->n_inputs && @@ -225,8 +220,8 @@ vips__reorder_set_input( VipsImage *image, VipsImage **in ) */ total = VIPS_MAX( 1, total ); - reorder->source = VIPS_ARRAY( NULL, total + 1, VipsImage * ); - reorder->cumulative_margin = VIPS_ARRAY( NULL, total, int ); + reorder->source = VIPS_ARRAY( image, total + 1, VipsImage * ); + reorder->cumulative_margin = VIPS_ARRAY( image, total, int ); if( !reorder->source || !reorder->cumulative_margin ) return( -1 );