diff options
author | Mike Reed <reed@google.com> | 2018-01-09 13:45:12 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-09 20:12:57 +0000 |
commit | 4d91e3091dda69b1d0d987761cf0358f8ae0f661 (patch) | |
tree | bd81ea3846516b668d6311ed7d6e6956607c6c86 /src | |
parent | 17b7c054339dfa592571ebd92d2419949baca6f0 (diff) |
handle text error in pictureplayback
Bug: skia:7476
Change-Id: Iae78ea9c446681e7c2459ed9083a8f76a26e3c48
Reviewed-on: https://skia-review.googlesource.com/92622
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPicturePlayback.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp index 4b9e080264..a3f8f818f5 100644 --- a/src/core/SkPicturePlayback.cpp +++ b/src/core/SkPicturePlayback.cpp @@ -78,8 +78,12 @@ public: fByteLength = reader->readInt(); fText = (const char*)reader->skip(fByteLength); if (reader->isValid()) { - fCount = SkPaintPriv::ValidCountText(fText, fByteLength, paint->getTextEncoding()); - reader->validate(fCount >= 0); + if (fByteLength == 0) { + fCount = 0; + } else { + fCount = SkPaintPriv::ValidCountText(fText, fByteLength, paint->getTextEncoding()); + reader->validate(fCount > 0); + } } } } |