From d614c6a4e059bd9ea5b882ca845e886a82aeff5c Mon Sep 17 00:00:00 2001 From: "scroggo@google.com" Date: Fri, 14 Sep 2012 17:26:37 +0000 Subject: For a picture playback with nothing written, use an empty SkData. This prevents crashing when attempting to access fOpData. BUG=https://code.google.com/p/skia/issues/detail?id=870 Review URL: https://codereview.appspot.com/6499108 git-svn-id: http://skia.googlecode.com/svn/trunk@5550 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkPicturePlayback.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp index cb4a83828d..e3181d0cb9 100644 --- a/src/core/SkPicturePlayback.cpp +++ b/src/core/SkPicturePlayback.cpp @@ -69,8 +69,10 @@ SkPicturePlayback::SkPicturePlayback(const SkPictureRecord& record, bool deepCop record.validate(); const SkWriter32& writer = record.writeStream(); init(); - if (writer.size() == 0) + if (writer.size() == 0) { + fOpData = SkData::NewEmpty(); return; + } fBoundingHierarchy = record.fBoundingHierarchy; fStateTree = record.fStateTree; -- cgit v1.2.3