Index: src/core/SkPictureData.h |
diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h |
index 0e351509bc91858cf59c3e4f7990bddf832440aa..353bbd935762ac484b44956a715ab5061f0243e6 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; |
} |