From 4de9b56725862edf872ae503a3dfb4cf05da9e77 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 4 Nov 2020 09:28:25 +0000 Subject: [PATCH] flush target at end of write we were missing end-of-write flushes on four save operations thanks harukizaemon see https://github.com/libvips/ruby-vips/issues/256 --- ChangeLog | 1 + libvips/foreign/csvsave.c | 2 ++ libvips/foreign/matrixsave.c | 2 ++ libvips/foreign/ppmsave.c | 2 ++ libvips/foreign/vipspng.c | 2 ++ 5 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2b6ad980..c2a3a01b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ - fix out of bounds exif read in heifload - fix out of bounds read in tiffload - fix tiffsave region shrink mode [imgifty] +- add missing flushes on write to target [harukizaemon] 6/9/20 started 8.10.2 - update magicksave/load profile handling [kelilevi] diff --git a/libvips/foreign/csvsave.c b/libvips/foreign/csvsave.c index a4178d56..ec4c4d2d 100644 --- a/libvips/foreign/csvsave.c +++ b/libvips/foreign/csvsave.c @@ -179,6 +179,8 @@ vips_foreign_save_csv_build( VipsObject *object ) if( vips_sink_disc( save->ready, vips_foreign_save_csv_block, csv ) ) return( -1 ); + vips_target_finish( csv->target ); + return( 0 ); } diff --git a/libvips/foreign/matrixsave.c b/libvips/foreign/matrixsave.c index fd93efba..cc8d7d8b 100644 --- a/libvips/foreign/matrixsave.c +++ b/libvips/foreign/matrixsave.c @@ -136,6 +136,8 @@ vips_foreign_save_matrix_build( VipsObject *object ) vips_foreign_save_matrix_block, matrix ) ) return( -1 ); + vips_target_finish( matrix->target ); + return( 0 ); } diff --git a/libvips/foreign/ppmsave.c b/libvips/foreign/ppmsave.c index 39b0320b..912a427e 100644 --- a/libvips/foreign/ppmsave.c +++ b/libvips/foreign/ppmsave.c @@ -301,6 +301,8 @@ vips_foreign_save_ppm( VipsForeignSavePpm *ppm, VipsImage *image ) if( vips_sink_disc( image, vips_foreign_save_ppm_block, ppm ) ) return( -1 ); + vips_target_finish( ppm->target ); + return( 0 ); } diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c index 78dd2585..cad03afb 100644 --- a/libvips/foreign/vipspng.c +++ b/libvips/foreign/vipspng.c @@ -1192,6 +1192,8 @@ write_vips( Write *write, png_write_end( write->pPng, write->pInfo ); + vips_target_finish( write->target ); + return( 0 ); }