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

Unified Diff: src/core/SkImageFilter.cpp

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: New SkSecureReadBuffer class 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 502613bb68835caf66d4dcb4d893b90b6697a1ad..2aa9bcf2a88c92bde5305fd7254f834cb047017f 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();
+ }
}
void SkImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {

Powered by Google App Engine
This is Rietveld 408576698