diff options
author | Mike Reed <reed@google.com> | 2017-12-21 13:34:24 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-21 21:06:44 +0000 |
commit | 889d521d8715f4934accb630097bc09bf7ad1a32 (patch) | |
tree | 6e41a72f078156cf8e5338ebd5165df191ab97fd /src/core/SkPaint.cpp | |
parent | 8957a1058e3937bc22192837d2fe87c4a8a047b7 (diff) |
validate text during deserialization
Bug: 796473
Change-Id: I7b6a6c698a5b53c915ef6564852fa51ce7410a3e
Reviewed-on: https://skia-review.googlesource.com/88520
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r-- | src/core/SkPaint.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 751bcedcf6..f8e5c11efd 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -420,9 +420,9 @@ int SkPaint::textToGlyphs(const void* textData, size_t byteLength, uint16_t glyp if (nullptr == glyphs) { switch (this->getTextEncoding()) { case kUTF8_TextEncoding: - return SkUTF8_CountUnichars((const char*)textData, byteLength); + return SkUTF8_CountUnichars(textData, byteLength); case kUTF16_TextEncoding: - return SkUTF16_CountUnichars((const uint16_t*)textData, SkToInt(byteLength >> 1)); + return SkUTF16_CountUnichars(textData, byteLength); case kUTF32_TextEncoding: return SkToInt(byteLength >> 2); case kGlyphID_TextEncoding: |