From e480cfbe97958a6badb7ede5e970137f859a66a6 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 5 May 2021 11:47:04 +0100 Subject: [PATCH] jxlload was not detecting EOF correctly it could loop in some circumstances --- libvips/foreign/jxlload.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libvips/foreign/jxlload.c b/libvips/foreign/jxlload.c index bda80130..4f6c47de 100644 --- a/libvips/foreign/jxlload.c +++ b/libvips/foreign/jxlload.c @@ -363,9 +363,10 @@ vips_foreign_load_jxl_process( VipsForeignLoadJxl *jxl ) size_t bytes_remaining; bytes_remaining = JxlDecoderReleaseInput( jxl->decoder ); - if( vips_foreign_load_jxl_fill_input( jxl, bytes_remaining ) && - bytes_remaining == 0 ) + if( vips_foreign_load_jxl_fill_input( jxl, bytes_remaining ) || + jxl->bytes_in_buffer == 0 ) return( JXL_DEC_ERROR ); + JxlDecoderSetInput( jxl->decoder, jxl->input_buffer, jxl->bytes_in_buffer ); }