OSDN Git Service

Fix doFadingAnimationLocked in sanitized builds.
authorIvan Lozano <ivanlozano@google.com>
Thu, 14 Dec 2017 20:25:36 +0000 (12:25 -0800)
committerIvan Lozano <ivanlozano@google.com>
Tue, 19 Dec 2017 16:17:31 +0000 (08:17 -0800)
commit7ee0dba09550811040df4d7b494766f7d146e3de
treed0ecaf5e1f625564e971e0641ccf5953397aa30e
parent53b2d749240f8c689b04155a960b75c40c00aba8
Fix doFadingAnimationLocked in sanitized builds.

The loop as constructed causes i to overflow twice when i = 0 on integer
overflow sanitized builds.

 runtime error: unsigned integer overflow: 0 - 1 cannot be represented
 in type 'size_t' (aka 'unsigned long')

 runtime error: unsigned integer overflow: 18446744073709551615 + 1
 cannot be represented in type 'size_t' (aka 'unsigned long')

This refactors the loop to avoid the overflows.

Bug: 30969751
Test: Compiles, device boots, enabled pointer location overlay.
Change-Id: I844bb3b84b1f536c50d06fb489fcc22590d4aa98
libs/input/PointerController.cpp