summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-08-03 15:02:31 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-03 15:02:31 -0700
commitda998f4845d4a4a783620bdd81d1c2feb9d404d3 (patch)
tree627378241ba4a274cc0de2c4d387659cff4c8e12 /services
parent52b8462635f1e807a88784634161f3b7598e1b7b (diff)
downloadframeworks_native-da998f4845d4a4a783620bdd81d1c2feb9d404d3.zip
frameworks_native-da998f4845d4a4a783620bdd81d1c2feb9d404d3.tar.gz
frameworks_native-da998f4845d4a4a783620bdd81d1c2feb9d404d3.tar.bz2
surfaceflinger: Unbreak casting and other use cases
* If QCOM WFD isn't in use, we'll get -1 here. Don't try and dig into the array because we'll get some random memory back. Change-Id: Ib14642fea760dc0e659473bb183c5e0116622302
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp b/services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp
index 64a67e5..a993405 100644
--- a/services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp
+++ b/services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp
@@ -78,6 +78,10 @@ bool ExHWComposer::isCompositionTypeBlit(const int32_t compType) const {
#if defined(QTI_BSP) && defined(SDM_TARGET)
uint32_t ExHWComposer::getS3DFlag(int disp) const {
+ if (disp < 0) {
+ return 0;
+ }
+
const DisplayData& disp_data(mDisplayData[disp]);
for (size_t i=0 ; i<disp_data.list->numHwLayers-1; i++) {