SkUTF8_CountUnichars(s,l) and SkUTF8_NextUnichar(s,l) now safe.
authorHal Canary <halcanary@google.com>
Wed, 11 Jan 2017 20:53:25 +0000 (15:53 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 11 Jan 2017 21:27:29 +0000 (21:27 +0000)
commitd1c8e56423f4d1a879f3a7bcd24e2725d9b690a7
tree7a054dc76e1818e3de7cfa553ff61ca511b13285
parentf046e15347373c20e42b1a25ecd87cbdb84de146
SkUTF8_CountUnichars(s,l) and SkUTF8_NextUnichar(s,l) now safe.

Theory:  We will accept blobs of data as utf-8 text without validation,
but when it comes time to process it: count code poits or convert to
code points, be careful to check for errors.

TODO: SkTypeface::charsToGlyphs() needs to take a length.

Change-Id: Id8110ab43dbffce96faffdda1e0bdaa39cad40e4
Reviewed-on: https://skia-review.googlesource.com/6849
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
src/core/SkPaint.cpp
src/core/SkUtils.cpp
src/core/SkUtils.h
src/pdf/SkPDFDevice.cpp
tests/UtilsTest.cpp