summaryrefslogtreecommitdiffstats
path: root/patches/ccpi-regularisation-toolkit-fgptv-integer-overflow.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/ccpi-regularisation-toolkit-fgptv-integer-overflow.patch')
-rw-r--r--patches/ccpi-regularisation-toolkit-fgptv-integer-overflow.patch12
1 files changed, 12 insertions, 0 deletions
diff --git a/patches/ccpi-regularisation-toolkit-fgptv-integer-overflow.patch b/patches/ccpi-regularisation-toolkit-fgptv-integer-overflow.patch
new file mode 100644
index 0000000..cc53b1d
--- /dev/null
+++ b/patches/ccpi-regularisation-toolkit-fgptv-integer-overflow.patch
@@ -0,0 +1,12 @@
+diff -dPNur CCPi-Regularisation-Toolkit-orig/src/Core/regularisers_CPU/FGP_TV_core.c CCPi-Regularisation-Toolkit/src/Core/regularisers_CPU/FGP_TV_core.c
+--- CCPi-Regularisation-Toolkit-orig/src/Core/regularisers_CPU/FGP_TV_core.c 2021-12-17 12:17:12.000000000 +0100
++++ CCPi-Regularisation-Toolkit/src/Core/regularisers_CPU/FGP_TV_core.c 2022-09-06 18:52:32.460225737 +0200
+@@ -104,7 +104,7 @@
+ else {
+ /*3D case*/
+ float *Output_prev=NULL, *P1=NULL, *P2=NULL, *P3=NULL, *P1_prev=NULL, *P2_prev=NULL, *P3_prev=NULL, *R1=NULL, *R2=NULL, *R3=NULL;
+- DimTotal = (long)(dimX*dimY*dimZ);
++ DimTotal = (long)dimX*(long)dimY*(long)dimZ;
+
+ if (epsil != 0.0f) Output_prev = calloc(DimTotal, sizeof(float));
+ P1 = calloc(DimTotal, sizeof(float));