From facd9dd4c75feb886240a2b55cefe55ccf773f63 Mon Sep 17 00:00:00 2001 From: Adnan AlSinan Date: Wed, 4 May 2022 11:31:45 +0100 Subject: Add a missing validation check to CPU Pool3d - Add a check for pooling region that is entirely outside input tensor. Signed-off-by: Adnan AlSinan Change-Id: Ib6b4565b1cb64235e714fe065b4a95f96a5adbd9 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7497 Tested-by: Arm Jenkins Reviewed-by: Gunes Bayir Comments-Addressed: Arm Jenkins --- src/cpu/kernels/CpuPool3dKernel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cpu/kernels/CpuPool3dKernel.cpp b/src/cpu/kernels/CpuPool3dKernel.cpp index 1305f7c5e8..4504f3f7c9 100644 --- a/src/cpu/kernels/CpuPool3dKernel.cpp +++ b/src/cpu/kernels/CpuPool3dKernel.cpp @@ -97,6 +97,8 @@ Status validate_arguments(const ITensorInfo *src, const ITensorInfo *dst, const int output_height = 0; int output_depth = 0; + ARM_COMPUTE_RETURN_ERROR_ON_MSG(is_pool_3d_region_entirely_outside_input(pool_info), "Pooling region that is entirely outside input tensor is unsupported"); + std::tie(output_width, output_height, output_depth) = scaled_3d_dimensions_signed(src->tensor_shape()[idx_width], src->tensor_shape()[idx_height], src->tensor_shape()[idx_depth], pool_size_x, pool_size_y, pool_size_z, pool_info); ARM_COMPUTE_RETURN_ERROR_ON_MSG((output_width < 1 || output_height < 1 || output_depth < 1), "Calculated output dimension size is invalid"); -- cgit v1.2.1