aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkPicturePlayback.cpp8
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);
+ }
}
}
}