aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/xps
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-12-21 13:34:24 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-21 21:06:44 +0000
commit889d521d8715f4934accb630097bc09bf7ad1a32 (patch)
tree6e41a72f078156cf8e5338ebd5165df191ab97fd /src/xps
parent8957a1058e3937bc22192837d2fe87c4a8a047b7 (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/xps')
-rw-r--r--src/xps/SkXPSDevice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xps/SkXPSDevice.cpp b/src/xps/SkXPSDevice.cpp
index 801b80c0b0..354070ce66 100644
--- a/src/xps/SkXPSDevice.cpp
+++ b/src/xps/SkXPSDevice.cpp
@@ -2022,9 +2022,9 @@ HRESULT SkXPSDevice::AddGlyphs(IXpsOMObjectFactory* xpsFactory,
static int num_glyph_guess(SkPaint::TextEncoding encoding, const void* text, size_t byteLength) {
switch (encoding) {
case SkPaint::kUTF8_TextEncoding:
- return SkUTF8_CountUnichars(static_cast<const char *>(text), byteLength);
+ return SkUTF8_CountUnichars(text, byteLength);
case SkPaint::kUTF16_TextEncoding:
- return SkUTF16_CountUnichars(static_cast<const uint16_t *>(text), SkToInt(byteLength));
+ return SkUTF16_CountUnichars(text, byteLength);
case SkPaint::kGlyphID_TextEncoding:
return SkToInt(byteLength / 2);
default: