From 6cff74b6027cc62e8a56a13787456d580aece5f3 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 4 Mar 2018 15:14:06 +0000 Subject: [PATCH] vips_image_write() could crash if called twice two writes in a row could trigger a crash in some circumstances, thanks @dirceupj see https://github.com/jcupitt/ruby-vips/issues/156 --- ChangeLog | 2 ++ libvips/iofuncs/image.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 70336ce4..37ba8378 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 12/2/18 started 8.6.3 - use pkg-config to find libjpeg, if we can +- better clean of output image in vips_image_write() fixes a crash + writing twice to memory 5/1/18 started 8.6.2 - vips_sink_screen() keeps a ref to the input image ... stops a rare race diff --git a/libvips/iofuncs/image.c b/libvips/iofuncs/image.c index 827ca99a..84f74004 100644 --- a/libvips/iofuncs/image.c +++ b/libvips/iofuncs/image.c @@ -2539,7 +2539,7 @@ vips_image_write( VipsImage *image, VipsImage *out ) vips_object_local( out, image ); } else { - vips__reorder_clear( image ); + vips__reorder_clear( out ); vips__link_break_all( out ); }