From da998f4845d4a4a783620bdd81d1c2feb9d404d3 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Wed, 3 Aug 2016 15:02:31 -0700 Subject: 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 --- services/surfaceflinger/ExSurfaceFlinger/ExHWComposer.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 ; inumHwLayers-1; i++) { -- cgit v1.1