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

Unified Diff: src/utils/SkGatherPixelRefsAndRects.h

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 | « src/gpu/GrReducedClip.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkGatherPixelRefsAndRects.h
diff --git a/src/utils/SkGatherPixelRefsAndRects.h b/src/utils/SkGatherPixelRefsAndRects.h
index 6e11fbe6d58a350f1c8008187a4114f0d3e96d6e..9589c3ea3852ba8a5fb2ffeccc13d47823c9186b 100644
--- a/src/utils/SkGatherPixelRefsAndRects.h
+++ b/src/utils/SkGatherPixelRefsAndRects.h
@@ -79,8 +79,9 @@ protected:
SkRect mappedRect;
draw.fMatrix->mapRect(&mappedRect, rect);
SkRect clipRect = SkRect::Make(draw.fRC->getBounds());
- mappedRect.intersect(clipRect);
- fPRCont->add(bm.pixelRef(), mappedRect);
+ if (mappedRect.intersect(clipRect)) {
+ fPRCont->add(bm.pixelRef(), mappedRect);
+ }
}
}
virtual void drawOval(const SkDraw& draw, const SkRect& rect,
« no previous file with comments | « src/gpu/GrReducedClip.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698