diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-11-15 04:12:37 +0000 |
---|---|---|
committer | Sheri Zhang <sheri.zhang@arm.com> | 2020-11-16 11:59:04 +0000 |
commit | c70f8b1a544fe3341310b7b329f37e885fdd0cdc (patch) | |
tree | 52f023e0bcdd755d64555a9012c6db3b16364b12 /arm_compute/core | |
parent | 61ffda4839d6fe8cc165faae0ec7c9be1d528194 (diff) | |
download | ComputeLibrary-c70f8b1a544fe3341310b7b329f37e885fdd0cdc.tar.gz |
COMPMID-3967: Fix NEColorConvert segfault
Force odd tensor shape adjustment in case of multi-planar images
to closest even towards infinity instead of zero.
This avoids issues when width or height are 1, which used to round down
to zero.
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Ia52380ae8941ed83128fb8a2351d7a2e9f4421d9
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4412
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core')
-rw-r--r-- | arm_compute/core/Utils.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h index 1c02e89ab6..e2c1ba938b 100644 --- a/arm_compute/core/Utils.h +++ b/arm_compute/core/Utils.h @@ -751,13 +751,13 @@ inline TensorShape adjust_odd_shape(const TensorShape &shape, Format format) // Force width to be even for formats which require subsampling of the U and V channels if(has_format_horizontal_subsampling(format)) { - output.set(0, output.x() & ~1U); + output.set(0, (output.x() + 1) & ~1U); } // Force height to be even for formats which require subsampling of the U and V channels if(has_format_vertical_subsampling(format)) { - output.set(1, output.y() & ~1U); + output.set(1, (output.y() + 1) & ~1U); } return output; |