diff options
author | robertphillips <robertphillips@google.com> | 2015-01-07 09:01:12 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-07 09:01:13 -0800 |
commit | 152f524fd325b7776b01f84afbfe2fa071648a05 (patch) | |
tree | 52255f53268067cf9e66272b67ca15711d8c4813 /src/gpu | |
parent | bd0d9da981289504c9dcd8547eaad52b1f4a52cb (diff) |
It is dangerous to ignore SkRect::intersect's return value
Review URL: https://codereview.chromium.org/833943002
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/GrReducedClip.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp index 3040b46313..ca97098794 100644 --- a/src/gpu/GrReducedClip.cpp +++ b/src/gpu/GrReducedClip.cpp @@ -409,7 +409,10 @@ void GrReducedClip::ReduceClipStack(const SkClipStack& stack, if (tighterBounds) { SkIRect stackIBounds; stackBounds.roundOut(&stackIBounds); - tighterBounds->intersect(queryBounds, stackIBounds); + if (!tighterBounds->intersect(queryBounds, stackIBounds)) { + SkASSERT(0); + tighterBounds->setEmpty(); + } bounds = tighterBounds; } } else { |