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

Unified Diff: src/core/SkXfermode.cpp

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Adding validation helper file Created 7 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
Index: src/core/SkXfermode.cpp
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index 1efd9efc4b2eae7a7ba7020e99a88d28e9e963f2..a0d960d3a001d39394c5af27448259234f8dcff2 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -12,6 +12,7 @@
#include "SkFlattenableBuffers.h"
#include "SkMathPriv.h"
#include "SkString.h"
+#include "SkValidation.h"
SK_DEFINE_INST_COUNT(SkXfermode)
@@ -1438,6 +1439,10 @@ protected:
fDstCoeff = rec.fDC;
// now update our function-ptr in the super class
this->INHERITED::setProc(rec.fProc);
+
+ buffer.validateData(IsValidMode(fMode) &&
+ IsValidCoeff(fSrcCoeff) &&
+ IsValidCoeff(fDstCoeff));
}
virtual void flatten(SkFlattenableWriteBuffer& buffer) const SK_OVERRIDE {

Powered by Google App Engine
This is Rietveld 408576698