diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-22 13:47:40 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-22 13:47:40 +0000 |
commit | 73c0abc2affdd5703f66c777e1cb3199179f3a09 (patch) | |
tree | 4dea719dc3499ab14f6c67251f7c58d4b40564a5 /src | |
parent | c9f3b38f67893b22c3e02a6a934bc676e36c5cfc (diff) |
Catch failures to SkTypeface::Deserialize() and use the default in that case.
This fixes cros bots, who are (for whatever reason) failing to deserialize one
of their fonts during picture-deserialization.
git-svn-id: http://skia.googlecode.com/svn/trunk@8796 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPicturePlayback.cpp | 8 |
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: { |