summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorNamit Solanki <nsolanki@codeaurora.org>2016-07-29 15:19:44 +0530
committerSteve Kondik <steve@cyngn.com>2016-08-13 01:31:13 -0700
commita5f80a555ab379546d4f96368b98bbf969229821 (patch)
tree8dbd0a8103a818ceebf2a6923c95c5decf215c5f /services
parent3b418d69a3e1b3594aec4ad065a47353da407e12 (diff)
downloadframeworks_native-a5f80a555ab379546d4f96368b98bbf969229821.zip
frameworks_native-a5f80a555ab379546d4f96368b98bbf969229821.tar.gz
frameworks_native-a5f80a555ab379546d4f96368b98bbf969229821.tar.bz2
surfaceflinger: Access s3d flags only for valid display ID.
- Check if display id is within display ID range. Negative display ids lead to undefined behavior in CTS tests. Change-Id: I2db8caf8d7ac65700e5bc37c180763357cc90aad CRs-Fixed: 1043297
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp b/services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp
index a993405..92cc1a7 100644
--- a/services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp
+++ b/services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp
@@ -82,6 +82,9 @@ uint32_t ExHWComposer::getS3DFlag(int disp) const {
return 0;
}
+ if (!mHwc || uint32_t(disp) >= MAX_HWC_DISPLAYS || !mAllocatedDisplayIDs.hasBit(disp))
+ return 0;
+
const DisplayData& disp_data(mDisplayData[disp]);
for (size_t i=0 ; i<disp_data.list->numHwLayers-1; i++) {