diff options
author | reed <reed@google.com> | 2016-09-30 09:27:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-30 09:27:20 -0700 |
commit | d921dbb9b88327eef7b1fbd42e9d88bace4a65ff (patch) | |
tree | 9e09b7892076ab1f71c82520c0609dbfc3b0f8a0 /src/core/SkPictureData.h | |
parent | 84741b308496409f4ff662658167221fc6801bbe (diff) |
Propagate validation errors from inner readbuffer when deserializing picture. Also allow null paints.
BUG=skia:5812
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2379383002
Review-Url: https://codereview.chromium.org/2379383002
Diffstat (limited to 'src/core/SkPictureData.h')
-rw-r--r-- | src/core/SkPictureData.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h index 0e351509bc..353bbd9357 100644 --- a/src/core/SkPictureData.h +++ b/src/core/SkPictureData.h @@ -117,6 +117,9 @@ public: const SkPaint* getPaint(SkReadBuffer* reader) const { const int index = reader->readInt() - 1; + if (index == -1) { // recorder wrote a zero for no paint (likely drawimage) + return nullptr; + } return reader->validateIndex(index, fPaints.count()) ? &fPaints[index] : nullptr; } |