From 1097147f9699d6e3b4d8cac2b6acf6eea47f551f Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Wed, 15 May 2019 15:14:46 +0100 Subject: 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 Reviewed-on: https://review.mlplatform.org/c/1141 Tested-by: Arm Jenkins Reviewed-by: Giuseppe Rossini Comments-Addressed: Arm Jenkins --- src/core/NEON/kernels/NEScaleKernel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/NEON/kernels/NEScaleKernel.cpp') 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(input->buffer() + input->info()->offset_first_element_in_bytes() - stride_w); } else -- cgit v1.2.1