aboutsummaryrefslogtreecommitdiff
path: root/source/convert.cc
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2022-08-04 14:38:13 -0700
committerFrank Barchard <fbarchard@chromium.org>2022-08-04 22:55:48 +0000
commitd53f1beecdd8d959f7a3f2e19bd0bd7e7227a233 (patch)
treedd04fcd4e0810ef845799039ae30e38fc462016f /source/convert.cc
parent394436b289b07bffae8e4d94f4020f4f3dfc1b09 (diff)
downloadlibyuv-d53f1beecdd8d959f7a3f2e19bd0bd7e7227a233.tar.gz
RAWToJ400 require multiple of 16 pixels for NEON
- fix crash when width is not a multiple of 16 - apply clang format - bump version Bug: libyuv:940, b/240094327 Change-Id: Ic18e5b7b64f78f26e8b7d8440bf490a679bda200 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3812594 Reviewed-by: Wan-Teh Chang <wtc@google.com>
Diffstat (limited to 'source/convert.cc')
-rw-r--r--source/convert.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/convert.cc b/source/convert.cc
index 162546e5..7178580f 100644
--- a/source/convert.cc
+++ b/source/convert.cc
@@ -1641,7 +1641,7 @@ int BGRAToI420(const uint8_t* src_bgra,
#if defined(HAS_BGRATOYROW_NEON)
if (TestCpuFlag(kCpuHasNEON)) {
BGRAToYRow = BGRAToYRow_Any_NEON;
- if (IS_ALIGNED(width, 8)) {
+ if (IS_ALIGNED(width, 16)) {
BGRAToYRow = BGRAToYRow_NEON;
}
}
@@ -3190,6 +3190,7 @@ int RAWToJ400(const uint8_t* src_raw,
if (!src_raw || !dst_yj || width <= 0 || height == 0) {
return -1;
}
+
if (height < 0) {
height = -height;
src_raw = src_raw + (height - 1) * src_stride_raw;
@@ -3201,6 +3202,7 @@ int RAWToJ400(const uint8_t* src_raw,
height = 1;
src_stride_raw = dst_stride_yj = 0;
}
+
#if defined(HAS_RAWTOYJROW_SSSE3)
if (TestCpuFlag(kCpuHasSSSE3)) {
RAWToYJRow = RAWToYJRow_Any_SSSE3;
@@ -3220,7 +3222,7 @@ int RAWToJ400(const uint8_t* src_raw,
#if defined(HAS_RAWTOYJROW_NEON)
if (TestCpuFlag(kCpuHasNEON)) {
RAWToYJRow = RAWToYJRow_Any_NEON;
- if (IS_ALIGNED(width, 8)) {
+ if (IS_ALIGNED(width, 16)) {
RAWToYJRow = RAWToYJRow_NEON;
}
}