aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkPicturePlayback.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 22125ee02b..d54a6c5f3b 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -508,7 +508,13 @@ void SkPicturePlayback::parseStreamTag(SkStream* stream, const SkPictInfo& info,
SkASSERT(!haveBuffer);
fTFPlayback.setCount(size);
for (size_t i = 0; i < size; i++) {
- SkSafeUnref(fTFPlayback.set(i, SkTypeface::Deserialize(stream)));
+ SkAutoTUnref<SkTypeface> tf(SkTypeface::Deserialize(stream));
+ if (!tf.get()) { // failed to deserialize
+ // fTFPlayback asserts it never has a null, so we plop in
+ // the default here.
+ tf.reset(SkTypeface::RefDefault());
+ }
+ fTFPlayback.set(i, tf);
}
} break;
case PICT_PICTURE_TAG: {