diff options
author | 2011-03-16 23:18:07 -0700 | |
---|---|---|
committer | 2011-03-17 00:04:42 -0700 | |
commit | f40e638ec62cd9e1a1851809b7c8bf5e4187fad2 (patch) | |
tree | fce830323935d7c7171c501278fb6c7ea9fdf9c8 /libs/ui/Region.cpp | |
parent | 7af7e00b9112f15d1683ae93975a6fcd9dd34da8 (diff) |
fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
a memory corruption happned when the buffer pool was resized
(like when playing a video or using camera) and there was
no current active buffer. In this case, the faulty code
would index into an array at position -1 which corrupted
24 bytes of data.
also improved region validation code (ifdef'ed out by default)
Bug: 4093196
Change-Id: I915c581d131148959d720e00e3892e9186ab733d
Diffstat (limited to 'libs/ui/Region.cpp')
-rw-r--r-- | libs/ui/Region.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp index 1994f6a4325f..a060a5f39db5 100644 --- a/libs/ui/Region.cpp +++ b/libs/ui/Region.cpp @@ -56,6 +56,9 @@ Region::Region() Region::Region(const Region& rhs) : mBounds(rhs.mBounds), mStorage(rhs.mStorage) { +#if VALIDATE_REGIONS + validate(rhs, "rhs copy-ctor"); +#endif } Region::Region(const Rect& rhs) @@ -76,7 +79,8 @@ Region::~Region() Region& Region::operator = (const Region& rhs) { #if VALIDATE_REGIONS - validate(rhs, "operator="); + validate(*this, "this->operator="); + validate(rhs, "rhs.operator="); #endif mBounds = rhs.mBounds; mStorage = rhs.mStorage; @@ -366,6 +370,12 @@ void Region::boolean_operation(int op, Region& dst, const Region& lhs, const Region& rhs, int dx, int dy) { +#if VALIDATE_REGIONS + validate(lhs, "boolean_operation (before): lhs"); + validate(rhs, "boolean_operation (before): rhs"); + validate(dst, "boolean_operation (before): dst"); +#endif + size_t lhs_count; Rect const * const lhs_rects = lhs.getArray(&lhs_count); |