diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 02c31fff2..2dad00517 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -635,6 +635,7 @@ status_t HWComposer::setFramebufferTarget(int32_t id, } status_t HWComposer::prepare() { + Mutex::Autolock _l(mDisplayLock); for (size_t i=0 ; i0] can be NULL. that display is to be ignored struct hwc_display_contents_1* mLists[MAX_HWC_DISPLAYS]; DisplayData mDisplayData[MAX_HWC_DISPLAYS]; + // protect mDisplayData from races between prepare and dump + mutable Mutex mDisplayLock; size_t mNumDisplays; cb_context* mCBContext;