aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPicturePlayback.cpp
diff options
context:
space:
mode:
authorGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-14 17:26:37 +0000
committerGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-14 17:26:37 +0000
commitd614c6a4e059bd9ea5b882ca845e886a82aeff5c (patch)
tree37469753a1eafa0d3207523130a934efa0955b0c /src/core/SkPicturePlayback.cpp
parent9548be3badb2e542035a20070cdfcd39e633f048 (diff)
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
Diffstat (limited to 'src/core/SkPicturePlayback.cpp')
-rw-r--r--src/core/SkPicturePlayback.cpp4
1 files changed, 3 insertions, 1 deletions
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;