aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2019-08-13 14:56:50 +0100
committerGian Marco Iodice <gianmarco.iodice@arm.com>2019-08-13 15:25:54 +0000
commit3ae323f941f55cf282caa75dffa5150dd975b321 (patch)
tree6c2110f7587e96b094157a0be3de491bc6103005 /src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp
parent670c04ac4e99ee4b9eeb231e9d980c927bddfaa0 (diff)
downloadComputeLibrary-3ae323f941f55cf282caa75dffa5150dd975b321.tar.gz
COMPMID-2580: Fix out of bound read in Depthwise Convolution layer (OpenCL)
Change-Id: I00e39ed21cc30034aa10ac58b64d533e833eafc8 Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Reviewed-on: https://review.mlplatform.org/c/1727 Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp
index fe796e96b8..c91dcece80 100644
--- a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp
+++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp
@@ -179,7 +179,7 @@ std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITen
num_elems_written_per_iteration_x = 8 / data_size_from_type(input->data_type());
num_elems_written_per_iteration_y = (is_qasymm && conv_stride_y == 1 && dilation.y() == 1) ? 2 : 1;
- num_elems_read_per_iteration_x = 3 + (num_elems_written_per_iteration_x - 1) * conv_stride_x;
+ num_elems_read_per_iteration_x = 3 + (num_elems_written_per_iteration_x - 1) * conv_stride_x + (conv_stride_x > 1 ? 1 : 0);
num_elems_read_per_iteration_y = num_elems_written_per_iteration_y + 2;
}
num_elems_read_per_iteration_x += (num_elems_read_per_iteration_x - 1) * (dilation.x() - 1);