summaryrefslogtreecommitdiff
path: root/msm8998
diff options
context:
space:
mode:
authorAshish Kumar <asku@codeaurora.org>2019-04-04 16:36:58 +0530
committerValerie Hau <vhau@google.com>2019-04-15 15:43:59 -0700
commit4aa0e63fc27030b81a4ed04aa481a54fc9c2ee31 (patch)
treee8015f6f048ba2e073f6e67ce168c37eeb695901 /msm8998
parentaee1b4836fd66997b75265ae5a45a1c624c2dfde (diff)
downloaddisplay-4aa0e63fc27030b81a4ed04aa481a54fc9c2ee31.tar.gz
sdm: core: Handle out of bound vector range in Dump.
Check hw_layer_count vs layer_stack size before accesing layers. Bug: 122275259 Test: build, boot, VtsHalGraphicsComposerV2_1TargetTest Change-Id: Idbfc2efed09947a27daf4b1b00ecacc508fca59d
Diffstat (limited to 'msm8998')
-rw-r--r--msm8998/sdm/libs/core/display_base.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/msm8998/sdm/libs/core/display_base.cpp b/msm8998/sdm/libs/core/display_base.cpp
index 9af8e809..3dcd504c 100644
--- a/msm8998/sdm/libs/core/display_base.cpp
+++ b/msm8998/sdm/libs/core/display_base.cpp
@@ -587,6 +587,9 @@ void DisplayBase::AppendDump(char *buffer, uint32_t length) {
for (uint32_t i = 0; i < num_hw_layers; i++) {
uint32_t layer_index = hw_layers_.info.index[i];
// sdm-layer from client layer stack
+ if (layer_index >= hw_layers_.info.stack->layers.size()) {
+ break;
+ }
Layer *sdm_layer = hw_layers_.info.stack->layers.at(layer_index);
// hw-layer from hw layers info
Layer &hw_layer = hw_layers_.info.hw_layers.at(i);