Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd1ec8a

Browse files
authored
convi: ensure double sum precision when multiplying floats (#4418)
1 parent 02e954e commit fd1ec8a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ChangeLog

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- svgload: add support for custom CSS via stylesheet option [lovell]
1313
- heifload: `unlimited` flag removes all limits (requires libheif 1.19.0+) [lovell]
1414
- heifsave: improve alpha channel detection [lovell]
15+
- convi: ensure double sum precision for floats [lovell]
1516

1617
8.16.1
1718

libvips/convolution/convi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ vips_convi_gen_vector(VipsRegion *out_region,
728728
\
729729
sum = 0; \
730730
for (i = 0; i < nnz; i++) \
731-
sum += t[i] * p[offsets[i]]; \
731+
sum += (double) t[i] * p[offsets[i]]; \
732732
\
733733
sum = (sum / scale) + offset; \
734734
\

0 commit comments

Comments
 (0)