aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-18 11:34:07 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-18 16:53:48 +0000
commita7f7ee96a77f1d17c459b6959a1552bc94db17fb (patch)
treefe0f123a665c6e1c1ca41c52b780d3d08e694bae
parentb6ba82ca0a5848afc81633cb1139e4c4807932c9 (diff)
turn assert into check for text
Bug: skia:7425 Change-Id: Ica173122dbe3cd1a3f94b2880a77c7e8b7e9cc8e Reviewed-on: https://skia-review.googlesource.com/96640 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
-rw-r--r--src/core/SkUtils.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/SkUtils.cpp b/src/core/SkUtils.cpp
index 6eceef52c1..d8ba2b39c1 100644
--- a/src/core/SkUtils.cpp
+++ b/src/core/SkUtils.cpp
@@ -279,7 +279,9 @@ int SkUTF16_CountUnichars(const void* text, size_t byteLength) {
return -1;
}
c = *src++;
- SkASSERT(SkUTF16_IsLowSurrogate(c));
+ if (!SkUTF16_IsLowSurrogate(c)) {
+ return -1;
+ }
}
count += 1;
}