diff options
author | Mathias Agopian <mathias@google.com> | 2011-09-19 16:12:08 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-09-19 16:50:17 -0700 |
commit | 0450452e8c6ea48341d57d8bc51d56252e9806b8 (patch) | |
tree | 9b2a02eb06afd8fea1731aed43b49edbb3342ca0 /libs/ui | |
parent | 000e95e7ebf1a60bbb7fda604b54092f45c87f89 (diff) | |
download | frameworks_native-0450452e8c6ea48341d57d8bc51d56252e9806b8.zip frameworks_native-0450452e8c6ea48341d57d8bc51d56252e9806b8.tar.gz frameworks_native-0450452e8c6ea48341d57d8bc51d56252e9806b8.tar.bz2 |
Make sure Region handles invalid rectangles
the boolean operation code assumes rects are valid and
could go into an infinite loop if not. make sure we
abort before that happens.
Bug: 5331198, 5334829
Change-Id: Iee4e3b838ecf504ef21f7447fd2e34a56e7dc3f8
Diffstat (limited to 'libs/ui')
-rw-r--r-- | libs/ui/Region.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp index a060a5f..8dab291 100644 --- a/libs/ui/Region.cpp +++ b/libs/ui/Region.cpp @@ -479,6 +479,11 @@ void Region::boolean_operation(int op, Region& dst, const Region& lhs, const Rect& rhs, int dx, int dy) { + if (!rhs.isValid()) { + LOGE("Region::boolean_operation(op=%d) invalid Rect={%d,%d,%d,%d}", + op, rhs.left, rhs.top, rhs.right, rhs.bottom); + } + #if VALIDATE_WITH_CORECG || VALIDATE_REGIONS boolean_operation(op, dst, lhs, Region(rhs), dx, dy); #else |