From 94db738773d3f4596486bd5fa4b8305fda8e3247 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 22 Jan 2016 17:43:42 +0000 Subject: [PATCH] fix double free on tiff write if you attached a profile to a tiff from a file during write, you'd get a double-free see https://github.com/jcupitt/libvips/issues/371 --- ChangeLog | 1 + libvips/foreign/vips2tiff.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 33e3c36d..11a75e0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ - use builtin isnan isinf when possible [Lovell Fuller] - tune vips_shrinkh(), 30% faster [Lovell Fuller] - remove SEQ hint from vips_subsample(), fixes cli performance [erdmann] +- fix double free on attach ICC profile from file in tiff write [erdmann] 1/1/16 started 8.2.1 - add a compat stub [Benjamin Gilbert] diff --git a/libvips/foreign/vips2tiff.c b/libvips/foreign/vips2tiff.c index 6e539c1c..24fc8f14 100644 --- a/libvips/foreign/vips2tiff.c +++ b/libvips/foreign/vips2tiff.c @@ -888,7 +888,7 @@ write_new( VipsImage *im, const char *filename, write->pyramid = pyramid; write->onebit = squash; write->miniswhite = miniswhite; - write->icc_profile = profile; + write->icc_profile = vips_strdup( NULL, profile ); write->bigtiff = bigtiff; write->rgbjpeg = rgbjpeg; write->properties = properties;