summaryrefslogtreecommitdiffstats
path: root/libs/gui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-08-08 19:35:15 -0700
committerMathias Agopian <mathias@google.com>2011-08-08 19:36:22 -0700
commit95dfd05c2c13735e5dbc1ae9e06fdba1053ffd8e (patch)
tree807f984b2964c474c6b65ad0afe01f85dade4775 /libs/gui
parent1a4a7364571d70f814037389a3ce69c133666407 (diff)
downloadframeworks_base-95dfd05c2c13735e5dbc1ae9e06fdba1053ffd8e.zip
frameworks_base-95dfd05c2c13735e5dbc1ae9e06fdba1053ffd8e.tar.gz
frameworks_base-95dfd05c2c13735e5dbc1ae9e06fdba1053ffd8e.tar.bz2
add some logs to track a crash in eglCreateImageKHR
Bug: 5111008 Change-Id: I3e7f5b986151e80cbded39e0dec057770da52fc1
Diffstat (limited to 'libs/gui')
-rw-r--r--libs/gui/SurfaceTexture.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 1a036ee..07789b3 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -628,16 +628,32 @@ status_t SurfaceTexture::updateTexImage() {
LOGV("SurfaceTexture::updateTexImage");
Mutex::Autolock lock(mMutex);
+ if (mAbandoned) {
+ LOGE("calling updateTexImage() on an abandoned SurfaceTexture");
+ //return NO_INIT;
+ }
+
// In asynchronous mode the list is guaranteed to be one buffer
// deep, while in synchronous mode we use the oldest buffer.
if (!mQueue.empty()) {
Fifo::iterator front(mQueue.begin());
int buf = *front;
+ if (uint32_t(buf) >= NUM_BUFFER_SLOTS) {
+ LOGE("buffer index out of range (index=%d)", buf);
+ //return BAD_VALUE;
+ }
+
// Update the GL texture object.
EGLImageKHR image = mSlots[buf].mEglImage;
if (image == EGL_NO_IMAGE_KHR) {
EGLDisplay dpy = eglGetCurrentDisplay();
+
+ if (mSlots[buf].mGraphicBuffer == 0) {
+ LOGE("buffer at slot %d is null", buf);
+ //return BAD_VALUE;
+ }
+
image = createImage(dpy, mSlots[buf].mGraphicBuffer);
mSlots[buf].mEglImage = image;
mSlots[buf].mEglDisplay = dpy;