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

Unified Diff: src/core/SkImageFilter.cpp

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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..7a8c6335a7276fd850a6c93843fcaf07bbe4ac7e 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -62,6 +62,11 @@ SkImageFilter::SkImageFilter(SkFlattenableReadBuffer& buffer)
}
}
buffer.readIRect(&fCropRect);
+
+ if ((fCropRect.fLeft > fCropRect.fRight) ||
+ (fCropRect.fTop > fCropRect.fBottom)) {
+ buffer.setError(kInvalidArgument_SkError);
reed1 2013/08/21 15:49:24 Should we "reset" ourselves since we're signaling
sugoi1 2013/08/21 16:52:36 I guess it depends if we intend to put error handl
+ }
}
void SkImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {

Powered by Google App Engine
This is Rietveld 408576698