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

Unified Diff: src/effects/SkBicubicImageFilter.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/SkBicubicImageFilter.cpp
diff --git a/src/effects/SkBicubicImageFilter.cpp b/src/effects/SkBicubicImageFilter.cpp
index 0ffcde6e2e13d4a7898a4b603297e1bedc079875..f45e9933ab6957236d9fc4e5d0efdb44125e06e9 100644
--- a/src/effects/SkBicubicImageFilter.cpp
+++ b/src/effects/SkBicubicImageFilter.cpp
@@ -45,6 +45,10 @@ SkBicubicImageFilter::SkBicubicImageFilter(SkFlattenableReadBuffer& buffer) : IN
SkASSERT(readSize == 16);
fScale.fWidth = buffer.readScalar();
fScale.fHeight = buffer.readScalar();
+ buffer.validateData(SkScalarIsFinite(fScale.fWidth) &&
+ SkScalarIsFinite(fScale.fHeight) &&
+ (fScale.fWidth >= 0) &&
+ (fScale.fHeight >= 0));
}
void SkBicubicImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {

Powered by Google App Engine
This is Rietveld 408576698