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

Unified Diff: gm/offsetimagefilter.cpp

Issue 833943002: It is dangerous to ignore SkRect::intersect's return value (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update Created 5 years, 12 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
« no previous file with comments | « gm/gmmain.cpp ('k') | include/core/SkRect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/offsetimagefilter.cpp
diff --git a/gm/offsetimagefilter.cpp b/gm/offsetimagefilter.cpp
index 7fcbe0a04db973ec8355bdac280bef6fc92ab0e9..3dafed8823ef498a798a99d8b59797d511e6e55d 100644
--- a/gm/offsetimagefilter.cpp
+++ b/gm/offsetimagefilter.cpp
@@ -82,8 +82,9 @@ protected:
scaleMatrix.setScale(scale, scale);
SkRect cropRectFloat;
scaleMatrix.mapRect(&cropRectFloat, SkRect::Make(cropRect));
- clipRect.intersect(cropRectFloat);
- canvas->drawRect(clipRect, strokePaint);
+ if (clipRect.intersect(cropRectFloat)) {
+ canvas->drawRect(clipRect, strokePaint);
+ }
}
virtual void onDraw(SkCanvas* canvas) {
« no previous file with comments | « gm/gmmain.cpp ('k') | include/core/SkRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698