From d381e499ead28937cdea5c3ac54aac35693769af Mon Sep 17 00:00:00 2001 From: Roman Cattaneo Date: Tue, 28 Nov 2017 13:48:40 +0100 Subject: [PATCH] Fixes Issue #10181 This PR fixes incorrect division by zero handling in template specialization of `Div_SIMD` for type `double`. --- modules/core/src/arithm_simd.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/src/arithm_simd.hpp b/modules/core/src/arithm_simd.hpp index 7d72383a31..373f940d0c 100644 --- a/modules/core/src/arithm_simd.hpp +++ b/modules/core/src/arithm_simd.hpp @@ -1724,8 +1724,8 @@ struct Div_SIMD v_float64x2 res0 = f0 * v_scale / f2; v_float64x2 res1 = f1 * v_scale / f3; - res0 = v_select(f0 == v_zero, v_zero, res0); - res1 = v_select(f1 == v_zero, v_zero, res1); + res0 = v_select(f2 == v_zero, v_zero, res0); + res1 = v_select(f3 == v_zero, v_zero, res1); v_store(dst + x, res0); v_store(dst + x + 2, res1);