jxlload was not detecting EOF correctly

it could loop in some circumstances
This commit is contained in:
John Cupitt 2021-05-05 11:47:04 +01:00
parent b87f5ba615
commit e480cfbe97

View File

@ -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 );
}