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

Unified Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Simplified SkRect/SkIRect validity tests 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/effects/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 331bbd7eddfd1982d1deef5e79978627075ba2a8..9ba5b6e00e574af602a63100a22dbb0e499d3954 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -24,6 +24,10 @@ SkMorphologyImageFilter::SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer
: INHERITED(buffer) {
fRadius.fWidth = buffer.readInt();
fRadius.fHeight = buffer.readInt();
+ buffer.validateData(SkScalarIsFinite(fRadius.fWidth) &&
+ SkScalarIsFinite(fRadius.fHeight) &&
+ (fRadius.fWidth >= 0) &&
+ (fRadius.fHeight >= 0));
}
SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input)

Powered by Google App Engine
This is Rietveld 408576698