aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2021-04-13 09:53:04 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2021-04-13 15:45:29 +0000
commitf4edddb8968c6e424333a066cf6fbbf9c1426f13 (patch)
treef3eb16a64cfac850e094c3d810f13055a61ef0bb
parent3dca91b84002f22f69ad5b9ddda0ce3579c4135b (diff)
downloadComputeLibrary-f4edddb8968c6e424333a066cf6fbbf9c1426f13.tar.gz
Check data type lower bound when creating a tensor
As underlying enum type can be an int we check also the lower bound of the data type when creating a tensor to avoid creation with negative values. Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Change-Id: I00fa3cae988c5f20a56115b1c1b85b70e699c966 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5413 Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--src/c/AclTensor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/c/AclTensor.cpp b/src/c/AclTensor.cpp
index 58b17ff70e..0d884b1ec3 100644
--- a/src/c/AclTensor.cpp
+++ b/src/c/AclTensor.cpp
@@ -38,7 +38,7 @@ constexpr int32_t max_allowed_dims = 6;
*/
bool is_desc_valid(const AclTensorDescriptor &desc)
{
- if(desc.data_type > AclFloat32)
+ if(desc.data_type > AclFloat32 || desc.data_type <= AclDataTypeUnknown)
{
ARM_COMPUTE_LOG_ERROR_ACL("[AclCreateTensor]: Unknown data type!");
return false;