Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc16f12

Browse files
committed
fix a memleak in tiff pyr to memory
we were not freeing layers other than the top layer
1 parent bddbecf commit dc16f12

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- better magickload error messages
44
- more consistent behaviour for page-height metadata
55
- fix for composite with many small images and some combinations of blend modes
6+
- fix memleak in tiff pyr save to memory [scossu]
67

78
21/9/18 started 8.8.0
89
- much faster smartcrop [lovell]

libvips/foreign/tiff.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,9 @@ vips__tiff_openout_buffer( VipsImage *image,
418418
printf( "vips__tiff_openout_buffer:\n" );
419419
#endif /*DEBUG*/
420420

421+
g_assert( out_data );
422+
g_assert( out_length );
423+
421424
buffer = VIPS_NEW( image, VipsTiffOpenoutBuffer );
422425
vips_dbuf_init( &buffer->dbuf );
423426
buffer->out_data = out_data;

libvips/foreign/vips2tiff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ layer_free( Layer *layer )
835835
VIPS_UNREF( layer->strip );
836836
VIPS_UNREF( layer->copy );
837837
VIPS_UNREF( layer->image );
838+
VIPS_FREE( layer->buf );
838839
VIPS_FREEF( TIFFClose, layer->tif );
839840
}
840841

0 commit comments

Comments
 (0)