diff options
author | Fedor Kudasov <kudasov@google.com> | 2019-06-24 09:07:03 +0100 |
---|---|---|
committer | Fedor Kudasov <kudasov@google.com> | 2019-06-24 08:15:27 +0000 |
commit | c53174301ca771f8a198bb818cda3874e1f72135 (patch) | |
tree | 648af8f10df2a11520c48dc9d240c05f432aaea7 /libs/hwui/pipeline | |
parent | 3d9b867900000292f958134119f29266d1f53737 (diff) |
Fix potential off-by-one
Being consistent with the notion of mEndChildIndex, it should be -1 by
default. Otherwise it assumes the display list has a single element.
This is consistent with EndReorderBarrierDrawable constructor that would
set mEndChildIndex to -1 if display list is empty.
Bug: 117921091
Test: all tests should pass
Change-Id: I64b84c789ad8126ac8f0b8c2ebfc128635e5b30d
Diffstat (limited to 'libs/hwui/pipeline')
-rw-r--r-- | libs/hwui/pipeline/skia/ReorderBarrierDrawables.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/pipeline/skia/ReorderBarrierDrawables.cpp b/libs/hwui/pipeline/skia/ReorderBarrierDrawables.cpp index 5133baebae18..3b8caeb3aab1 100644 --- a/libs/hwui/pipeline/skia/ReorderBarrierDrawables.cpp +++ b/libs/hwui/pipeline/skia/ReorderBarrierDrawables.cpp @@ -27,7 +27,7 @@ namespace uirenderer { namespace skiapipeline { StartReorderBarrierDrawable::StartReorderBarrierDrawable(SkiaDisplayList* data) - : mEndChildIndex(0), mBeginChildIndex(data->mChildNodes.size()), mDisplayList(data) {} + : mEndChildIndex(-1), mBeginChildIndex(data->mChildNodes.size()), mDisplayList(data) {} void StartReorderBarrierDrawable::onDraw(SkCanvas* canvas) { if (mChildren.empty()) { |