From d873fe66ab371abdf9bb93d4e3dfee1d3dcd9906 Mon Sep 17 00:00:00 2001 From: Vitaly Tuzov Date: Thu, 13 Apr 2017 17:45:42 +0300 Subject: [PATCH] Fixed size estimation for copyFrom/To vector in vx_matrix and vx_convolution wrappers --- 3rdparty/openvx/include/ivx.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/3rdparty/openvx/include/ivx.hpp b/3rdparty/openvx/include/ivx.hpp index 5c3029d617..5f8423fa61 100644 --- a/3rdparty/openvx/include/ivx.hpp +++ b/3rdparty/openvx/include/ivx.hpp @@ -2508,10 +2508,10 @@ public: { if (!areTypesCompatible(TypeToEnum::value, dataType())) throw WrapperError(std::string(__func__) + "(): destination type is wrong"); - if (data.size() != size()) + if (data.size()*sizeof(T) != size()) { if (data.size() == 0) - data.resize(size()); + data.resize(size()/sizeof(T)); else throw WrapperError(std::string(__func__) + "(): destination size is wrong"); } @@ -2522,7 +2522,7 @@ public: { if (!areTypesCompatible(TypeToEnum::value, dataType())) throw WrapperError(std::string(__func__) + "(): source type is wrong"); - if (data.size() != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong"); + if (data.size()*sizeof(T) != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong"); copyFrom(&data[0]); } @@ -2670,10 +2670,10 @@ public: { if (!areTypesCompatible(TypeToEnum::value, dataType())) throw WrapperError(std::string(__func__) + "(): destination type is wrong"); - if (data.size() != size()) + if (data.size()*sizeof(T) != size()) { if (data.size() == 0) - data.resize(size()); + data.resize(size()/sizeof(T)); else throw WrapperError(std::string(__func__) + "(): destination size is wrong"); } @@ -2684,7 +2684,7 @@ public: { if (!areTypesCompatible(TypeToEnum::value, dataType())) throw WrapperError(std::string(__func__) + "(): source type is wrong"); - if (data.size() != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong"); + if (data.size()*sizeof(T) != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong"); copyFrom(&data[0]); } -- GitLab