diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index e6472752e..902570b93 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1537,7 +1537,11 @@ void SurfaceFlinger::doComposeSurfaces(const sp& hw, const const bool hasGlesComposition = hwc.hasGlesComposition(id) || (cur==end); if (hasGlesComposition) { - DisplayDevice::makeCurrent(mEGLDisplay, hw, mEGLContext); + if (!DisplayDevice::makeCurrent(mEGLDisplay, hw, mEGLContext)) { + ALOGW("DisplayDevice::makeCurrent failed. Aborting surface composition for display %s", + hw->getDisplayName().string()); + return; + } // set the frame buffer glMatrixMode(GL_MODELVIEW);