From 915226db212f684d6e2ba8bdcc1785c0630aff79 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 4 Apr 2018 17:46:14 +0100 Subject: [PATCH] oop missing a seek --- libvips/foreign/radiance.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libvips/foreign/radiance.c b/libvips/foreign/radiance.c index 231d9b19..955d4c98 100644 --- a/libvips/foreign/radiance.c +++ b/libvips/foreign/radiance.c @@ -1299,11 +1299,16 @@ static int vips2rad_put_data_block( VipsRegion *region, VipsRect *area, void *a ) { Write *write = (Write *) a; - size_t size; - unsigned char *buffer = vips_dbuf_get_write( &write->dbuf, &size ); + size_t size; + unsigned char *buffer; int i; + /* You have to seek back after a write. + */ + buffer = vips_dbuf_get_write( &write->dbuf, &size ); + vips_dbuf_seek( &write->dbuf, 0, SEEK_SET ); + g_assert( size >= MAX_LINE ); for( i = 0; i < area->height; i++ ) {