From c89998fa843de85d6f107e4b346f3490a188367a Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Thu, 26 Aug 2021 14:11:44 +0100 Subject: Fix strict overflow warnings Resolves COMPMID-2138 Change-Id: I5587fe53ec99d164413cde1809d1791bf909b8df Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6171 Reviewed-by: Michele Di Giorgio Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins --- src/cpu/kernels/scale/neon/qasymm8.cpp | 2 +- src/cpu/kernels/scale/neon/qasymm8_signed.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cpu/kernels/scale') diff --git a/src/cpu/kernels/scale/neon/qasymm8.cpp b/src/cpu/kernels/scale/neon/qasymm8.cpp index fb52752690..daa157ec3d 100644 --- a/src/cpu/kernels/scale/neon/qasymm8.cpp +++ b/src/cpu/kernels/scale/neon/qasymm8.cpp @@ -74,7 +74,7 @@ void qasymm8_neon_scale_bilinear(const ITensor *src, ITensor *dst, const ITensor const auto a00 = (0 <= index_w && index_w < in_dim_w && 0 <= index_h && index_h < in_dim_h) ? (*(pixel_row_ptr + index_w * stride_w + index_h * stride_h)) : const_border_value; - const auto a01 = (-1 <= index_w && index_w < in_dim_w - 1 && 0 <= index_h && index_h < in_dim_h) ? + const auto a01 = (-1 <= index_w && index_w + 1 < in_dim_w && 0 <= index_h && index_h < in_dim_h) ? (*(pixel_row_ptr + (index_w + 1) * stride_w + index_h * stride_h)) : const_border_value; const auto a10 = (0 <= index_w && index_w < in_dim_w && -1 <= index_h && index_h < in_dim_h - 1) ? diff --git a/src/cpu/kernels/scale/neon/qasymm8_signed.cpp b/src/cpu/kernels/scale/neon/qasymm8_signed.cpp index 706bcee954..83312636b4 100644 --- a/src/cpu/kernels/scale/neon/qasymm8_signed.cpp +++ b/src/cpu/kernels/scale/neon/qasymm8_signed.cpp @@ -74,7 +74,7 @@ void qasymm8_signed_neon_scale_bilinear(const ITensor *src, ITensor *dst, const const auto a00 = (0 <= index_w && index_w < in_dim_w && 0 <= index_h && index_h < in_dim_h) ? (*(pixel_row_ptr + index_w * stride_w + index_h * stride_h)) : const_border_value; - const auto a01 = (-1 <= index_w && index_w < in_dim_w - 1 && 0 <= index_h && index_h < in_dim_h) ? + const auto a01 = (-1 <= index_w && index_w + 1 < in_dim_w && 0 <= index_h && index_h < in_dim_h) ? (*(pixel_row_ptr + (index_w + 1) * stride_w + index_h * stride_h)) : const_border_value; const auto a10 = (0 <= index_w && index_w < in_dim_w && -1 <= index_h && index_h < in_dim_h - 1) ? -- cgit v1.2.1