diff --git a/libvips/iofuncs/sinkdisc.c b/libvips/iofuncs/sinkdisc.c index f686d6fc..3abd0bb9 100644 --- a/libvips/iofuncs/sinkdisc.c +++ b/libvips/iofuncs/sinkdisc.c @@ -334,8 +334,10 @@ wbuffer_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) /* Block until the write of the previous buffer * is done, then set write of this buffer going. */ - if( wbuffer_flush( write ) ) + if( wbuffer_flush( write ) ) { + *stop = TRUE; return( -1 ); + } /* End of image? */ @@ -359,8 +361,10 @@ wbuffer_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) /* Position buf at the new y. */ if( wbuffer_position( write->buf, - sink_base->y, sink_base->nlines ) ) + sink_base->y, sink_base->nlines ) ) { + *stop = TRUE; return( -1 ); + } } }