summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2014-04-25 11:40:39 +0900
committerMichel Dänzer <[email protected]>2014-04-28 12:12:03 +0900
commit136c437cea3ebc9541735bb40951128e1210f06b (patch)
tree83406a4bc0f1365da5c77c5f3c638399f2f1cfdf /src
parent151a20dcd42c0973275479609470c2b616b3faa9 (diff)
st/mesa: Fix NULL pointer dereference for incomplete framebuffers
This can happen with glamor, which uses EGL_KHR_surfaceless_context and only explicitly binds GL_READ_FRAMEBUFFER for glReadPixels. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_manager.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index f573877dc04..706af7fd13d 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -183,8 +183,13 @@ st_framebuffer_validate(struct st_framebuffer *stfb,
uint width, height;
unsigned i;
boolean changed = FALSE;
- int32_t new_stamp = p_atomic_read(&stfb->iface->stamp);
+ int32_t new_stamp;
+ /* Check for incomplete framebuffers (e.g. EGL_KHR_surfaceless_context) */
+ if (!stfb->iface)
+ return;
+
+ new_stamp = p_atomic_read(&stfb->iface->stamp);
if (stfb->iface_stamp == new_stamp)
return;