aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/NEPoolingLayerKernel.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-05-14 12:47:59 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:52:21 +0000
commit7b94c3e3bb88a9ad69178af0396f908b5833e2ea (patch)
tree4746f2d5543b8e9b55bfcd9bea23a4a35b361d4c /src/core/NEON/kernels/NEPoolingLayerKernel.cpp
parentb2d9ebb26438b5b90300dfc655446747e466574b (diff)
downloadComputeLibrary-7b94c3e3bb88a9ad69178af0396f908b5833e2ea.tar.gz
COMPMID-1139: Fix SIGSEGV in arm_compute_benchmark
Invalid boundary checks. Change-Id: I9c346dc15d2080f710b283364e83831fa3466941 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/131029 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/NEPoolingLayerKernel.cpp')
-rw-r--r--src/core/NEON/kernels/NEPoolingLayerKernel.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/NEON/kernels/NEPoolingLayerKernel.cpp b/src/core/NEON/kernels/NEPoolingLayerKernel.cpp
index be706e2e83..7877cf5cc0 100644
--- a/src/core/NEON/kernels/NEPoolingLayerKernel.cpp
+++ b/src/core/NEON/kernels/NEPoolingLayerKernel.cpp
@@ -2143,14 +2143,14 @@ void NEPoolingLayerKernel::poolingMxN_f16_nhwc(const Window &window_input, const
for(int y = 0; y < pool_size_y; ++y)
{
- if(y + idx_height > window_input.z().end() || y + idx_height - pool_pad_top < window_input.z().start())
+ if(y + idx_height - pool_pad_top >= window_input.z().end() || y + idx_height - pool_pad_top < window_input.z().start())
{
continue;
}
for(int x = 0; x < pool_size_x; ++x)
{
- if(x + idx_width > window_input.y().end() || x + idx_width - pool_pad_left < window_input.y().start())
+ if(x + idx_width - pool_pad_left >= window_input.y().end() || x + idx_width - pool_pad_left < window_input.y().start())
{
continue;
}
@@ -2374,14 +2374,14 @@ void NEPoolingLayerKernel::poolingMxN_f32_nhwc(const Window &window_input, const
for(int y = 0; y < pool_size_y; ++y)
{
- if(y + idx_height > window_input.z().end() || y + idx_height - pool_pad_top < window_input.z().start())
+ if(y + idx_height - pool_pad_top >= window_input.z().end() || y + idx_height - pool_pad_top < window_input.z().start())
{
continue;
}
for(int x = 0; x < pool_size_x; ++x)
{
- if(x + idx_width > window_input.y().end() || x + idx_width - pool_pad_left < window_input.y().start())
+ if(x + idx_width - pool_pad_left >= window_input.y().end() || x + idx_width - pool_pad_left < window_input.y().start())
{
continue;
}
@@ -2408,14 +2408,14 @@ void NEPoolingLayerKernel::poolingMxN_f32_nhwc(const Window &window_input, const
vres = vdupq_n_f32(std::numeric_limits<float>::lowest());
for(int y = 0; y < pool_size_y; ++y)
{
- if(y + idx_height > window_input.z().end() || y + idx_height - pool_pad_top < window_input.z().start())
+ if(y + idx_height - pool_pad_top >= window_input.z().end() || y + idx_height - pool_pad_top < window_input.z().start())
{
continue;
}
for(int x = 0; x < pool_size_x; ++x)
{
- if(x + idx_width > window_input.y().end() || x + idx_width - pool_pad_left < window_input.y().start())
+ if(x + idx_width - pool_pad_left >= window_input.y().end() || x + idx_width - pool_pad_left < window_input.y().start())
{
continue;
}
@@ -2571,14 +2571,14 @@ void NEPoolingLayerKernel::poolingMxN_qasymm8_nhwc(const Window &window_input, c
// Perform pooling
for(int y = 0; y < pool_size_y; ++y)
{
- if(y + idx_height > window_input.z().end() || y + idx_height - pool_pad_top < window_input.z().start())
+ if(y + idx_height - pool_pad_top >= window_input.z().end() || y + idx_height - pool_pad_top < window_input.z().start())
{
continue;
}
for(int x = 0; x < pool_size_x; ++x)
{
- if(x + idx_width > window_input.y().end() || x + idx_width - pool_pad_left < window_input.y().start())
+ if(x + idx_width - pool_pad_left >= window_input.y().end() || x + idx_width - pool_pad_left < window_input.y().start())
{
continue;
}
@@ -2606,14 +2606,14 @@ void NEPoolingLayerKernel::poolingMxN_qasymm8_nhwc(const Window &window_input, c
for(int y = 0; y < pool_size_y; ++y)
{
- if(y + idx_height > window_input.z().end() || y + idx_height - pool_pad_top < window_input.z().start())
+ if(y + idx_height - pool_pad_top >= window_input.z().end() || y + idx_height - pool_pad_top < window_input.z().start())
{
continue;
}
for(int x = 0; x < pool_size_x; ++x)
{
- if(x + idx_width > window_input.y().end() || x + idx_width - pool_pad_left < window_input.y().start())
+ if(x + idx_width - pool_pad_left >= window_input.y().end() || x + idx_width - pool_pad_left < window_input.y().start())
{
continue;
}