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

Unified Diff: skia/ext/analysis_canvas.cc

Issue 1065353002: Fix use of uninitialized memory in skia/ext/analysis_canvas.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/analysis_canvas.cc
diff --git a/skia/ext/analysis_canvas.cc b/skia/ext/analysis_canvas.cc
index 0ff16602d9cc1a8787c2f94a40f5bb7584c5fab7..066f35f7e04c20598abff632272ff272493272e5 100644
--- a/skia/ext/analysis_canvas.cc
+++ b/skia/ext/analysis_canvas.cc
@@ -60,7 +60,9 @@ bool IsFullQuad(SkCanvas* canvas, const SkRect& drawn_rect) {
return false;
SkIRect clip_irect;
- canvas->getClipDeviceBounds(&clip_irect);
+ if (!canvas->getClipDeviceBounds(&clip_irect))
+ return false;
+
// if the clip is smaller than the canvas, we're partly clipped, so abort.
if (!clip_irect.contains(SkIRect::MakeSize(canvas->getDeviceSize())))
return false;
@@ -96,8 +98,8 @@ void AnalysisCanvas::SetForceNotTransparent(bool flag) {
void AnalysisCanvas::onDrawPaint(const SkPaint& paint) {
SkRect rect;
- getClipBounds(&rect);
- drawRect(rect, paint);
+ if (getClipBounds(&rect))
+ drawRect(rect, paint);
}
void AnalysisCanvas::onDrawPoints(SkCanvas::PointMode mode,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698