Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: src/core/SkPictureData.h

Issue 2379383002: Propagate validation errors (Closed)
Patch Set: check for null buffer Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkPicturePlayback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkPicturePlayback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698