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

Unified Diff: src/core/SkImageFilter.cpp

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 2nd proposition, with some comments adressed Created 7 years, 4 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/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 222a02999715b658862474098a2cf0216665ab57..40ad6730cf284e35d136c872d3eac561b6891487 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -62,6 +62,15 @@ SkImageFilter::SkImageFilter(SkFlattenableReadBuffer& buffer)
}
}
buffer.readIRect(&fCropRect);
+
+ if (!SkScalarIsFinite(fCropRect.fLeft) ||
reed1 2013/08/22 15:41:14 SkIRect stores ints, so calling isfinite does not
sugoi1 2013/08/22 17:37:02 Oops, fixed.
+ !SkScalarIsFinite(fCropRect.fRight) ||
+ !SkScalarIsFinite(fCropRect.fTop) ||
+ !SkScalarIsFinite(fCropRect.fBottom) ||
+ (fCropRect.fLeft > fCropRect.fRight) ||
+ (fCropRect.fTop > fCropRect.fBottom)) {
sugoi 2013/08/21 20:19:39 Although it's counter intuitive, "top" really has
scroggo 2013/08/21 23:56:00 Depends on which way you think the y-axis should g
+ buffer.setError();
+ }
}
void SkImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {

Powered by Google App Engine
This is Rietveld 408576698