Warning, /graphics/krita/3rdparty/ext_lcms2/0001-Fix-Krita-segfault.patch is written in an unsupported language. File is not indexed.
0001 From aa7f240da8dc27a0bb082462889cca9026bf2b27 Mon Sep 17 00:00:00 2001 0002 From: Marti Maria <marti.maria@littlecms.com> 0003 Date: Thu, 20 Oct 2022 15:24:27 +0200 0004 Subject: [PATCH 1/2] Fix Krita segfault 0005 0006 _cmsQuickFloor() fails when numbers are too close, on fourth decimals, floor of 47.9993 was taken as 48 instead of 47 and this was enough to generate a negative rest and create a segfault. Math is sometimes complex. 0007 --- 0008 plugins/fast_float/src/fast_float_tethra.c | 6 +++--- 0009 1 file changed, 3 insertions(+), 3 deletions(-) 0010 0011 diff --git a/plugins/fast_float/src/fast_float_tethra.c b/plugins/fast_float/src/fast_float_tethra.c 0012 index 64e011a..6c49774 100644 0013 --- a/plugins/fast_float/src/fast_float_tethra.c 0014 +++ b/plugins/fast_float/src/fast_float_tethra.c 0015 @@ -134,9 +134,9 @@ void FloatCLUTEval(struct _cmstransform_struct* CMMcargo, 0016 py = g * p->Domain[1]; 0017 pz = b * p->Domain[2]; 0018 0019 - x0 = _cmsQuickFloor(px); rx = (px - (cmsFloat32Number)x0); 0020 - y0 = _cmsQuickFloor(py); ry = (py - (cmsFloat32Number)y0); 0021 - z0 = _cmsQuickFloor(pz); rz = (pz - (cmsFloat32Number)z0); 0022 + x0 = (int) floorf(px); rx = (px - (cmsFloat32Number)x0); 0023 + y0 = (int) floorf(py); ry = (py - (cmsFloat32Number)y0); 0024 + z0 = (int) floorf(pz); rz = (pz - (cmsFloat32Number)z0); 0025 0026 0027 X0 = p->opta[2] * x0; 0028 -- 0029 2.37.1.windows.1 0030