aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/NEScaleKernel.cpp
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2019-05-15 15:14:46 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2019-05-17 08:05:09 +0000
commit1097147f9699d6e3b4d8cac2b6acf6eea47f551f (patch)
tree67aed1459763131cb49e591138da929262458773 /src/core/NEON/kernels/NEScaleKernel.cpp
parent6ac5992dc81534e81482892f8fb8c03790c57192 (diff)
downloadComputeLibrary-1097147f9699d6e3b4d8cac2b6acf6eea47f551f.tar.gz
COMPMID-2335: Crash in scale_bilinear_nhwc_core
NEScaleKernel crashes in scale_bilinear_nhwc_core trying to read the top padding but the configure() method sets the border to 0 for REPLICATE, so the crash can happen if REPLICATE+BILINEAR+USE_PADDING is used when configuring the function. Change-Id: I5f86da46c2525b67e41c7e1564b89bacac54cea0 Signed-off-by: Pablo Tello <pablo.tello@arm.com> Reviewed-on: https://review.mlplatform.org/c/1141 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Giuseppe Rossini <giuseppe.rossini@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/NEScaleKernel.cpp')
-rw-r--r--src/core/NEON/kernels/NEScaleKernel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/NEON/kernels/NEScaleKernel.cpp b/src/core/NEON/kernels/NEScaleKernel.cpp
index 33540393e4..003f472486 100644
--- a/src/core/NEON/kernels/NEScaleKernel.cpp
+++ b/src/core/NEON/kernels/NEScaleKernel.cpp
@@ -218,8 +218,9 @@ inline void scale_bilinear_nhwc_core(const ITensor *input, const ITensor *offset
const int input_height = input->info()->dimension(2);
T border_value;
- if(use_padding)
+ if(use_padding && border_mode != BorderMode::REPLICATE )
{
+ // configure() sets top border to 0 for BorderMode::REPLICATE and border_value is not needed in execute_window_loop() for REPLICATE
border_value = *reinterpret_cast<T *>(input->buffer() + input->info()->offset_first_element_in_bytes() - stride_w);
}
else