From c8713a367c7d7d3b202158debbc38eae1a29bcc7 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 18 Dec 2017 19:34:28 +0000 Subject: [PATCH] Prevent ~15KB leak for JPEG buffer output error --- libvips/foreign/vips2jpeg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libvips/foreign/vips2jpeg.c b/libvips/foreign/vips2jpeg.c index c9eb54dc..adae118b 100644 --- a/libvips/foreign/vips2jpeg.c +++ b/libvips/foreign/vips2jpeg.c @@ -816,6 +816,9 @@ vips__jpeg_write_buffer( VipsImage *in, Q, profile, optimize_coding, progressive, strip, no_subsample, trellis_quant, overshoot_deringing, optimize_scans, quant_table ) ) { + term_destination( &write->cinfo ); + VIPS_FREE( *obuf ); + *olen = 0; write_destroy( write ); return( -1 );