commit | 8eb533537784c4d5cf2f50f578f3861cdf83b947 | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Mon Nov 06 11:04:12 2017 -0800 |
committer | Joel Galenson <jgalenson@google.com> | Wed Dec 20 15:17:19 2017 -0800 |
tree | 960917c8438fbe25de019e92dd199173d7981b9e | |
parent | 1a49778eccfeea3614465e83c53b66f786ecad32 [diff] |
Fix surfaceflinger on integer sanitized builds. Refactors unsigned integer overflows in traverseInReverseZOrder to fix integer overflow sanitized builds. Test: Compiled and checked output from sanitizer. Bug: 30969751 Change-Id: I46299e7044d360e35ca35a5448b34e4299a500b7 Merged-In: I46299e7044d360e35ca35a5448b34e4299a500b7
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index ca9a546..45cabc3 100755 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp
@@ -2714,7 +2714,7 @@ LayerVector list = makeTraversalList(stateSet); int32_t i = 0; - for (i = list.size()-1; i>=0; i--) { + for (i = int32_t(list.size()) - 1; i >= 0; i--) { const auto& relative = list[i]; if (relative->getZ() < 0) { break;