aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureData.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-19 12:28:52 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-19 17:59:13 +0000
commite58260031e28a687b940fe3a5747927872d892e8 (patch)
treef41d42529d2815d64fefb4f932e7a6e98236dfcf /src/core/SkPictureData.h
parent2cc7d139786d228bb70be2b988720c4c59329d93 (diff)
make rrect's more self-consistent, check drawable index
Bug: skia:7403 Change-Id: Ifb8f9ffce2acb1c6f1ebc6c733ad3b6c0865409a Reviewed-on: https://skia-review.googlesource.com/91503 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'src/core/SkPictureData.h')
-rw-r--r--src/core/SkPictureData.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h
index 89ddcfaabe..d9cb824fd5 100644
--- a/src/core/SkPictureData.h
+++ b/src/core/SkPictureData.h
@@ -116,9 +116,8 @@ public:
}
SkDrawable* getDrawable(SkReadBuffer* reader) const {
- int index = reader->readInt();
- SkASSERT(index > 0 && index <= fDrawableCount);
- return fDrawableRefs[index - 1];
+ int index = reader->readInt() - 1;
+ return reader->validateIndex(index, fDrawableCount) ? fDrawableRefs[index] : nullptr;
}
const SkPaint* getPaint(SkReadBuffer* reader) const {