use safeunref on typefaces, since Deserialize might return NULL.

git-svn-id: http://skia.googlecode.com/svn/trunk@1969 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-07-27 14:16:03 +00:00
parent c9493a4a68
commit 90751c5788

View File

@ -410,7 +410,7 @@ SkPicturePlayback::SkPicturePlayback(SkStream* stream) {
int typefaceCount = readTagSize(stream, PICT_TYPEFACE_TAG);
fTFPlayback.setCount(typefaceCount);
for (i = 0; i < typefaceCount; i++) {
fTFPlayback.set(i, SkTypeface::Deserialize(stream))->unref();
SkSafeUnref(fTFPlayback.set(i, SkTypeface::Deserialize(stream)));
}
fPictureCount = readTagSize(stream, PICT_PICTURE_TAG);