summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-04-21 15:11:34 +0200
committerNicolai Hähnle <[email protected]>2017-04-28 11:34:00 +0200
commit9d346af322e3f9d6d52e00759e8c3cd37c192004 (patch)
tree6b705702afb316967718c9d39e0cad3ff6126a06 /src/mesa
parent19b61799e3d06795d783b34fdbbf8474ef1e9a7c (diff)
st/mesa: remove redundant stfb->iface checks
stfb->iface is always non-NULL for an st_framebuffer. These checks were incorrect, relying on out-of-bounds memory access in the surface-less case of EGL_KHR_surfaceless_context. v2: remove redundant stread check (Marek) Reviewed-by: Marek Olšák <marek@[email protected]> (v2)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_cb_viewport.c4
-rw-r--r--src/mesa/state_tracker/st_manager.c7
2 files changed, 2 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_cb_viewport.c b/src/mesa/state_tracker/st_cb_viewport.c
index ff18fd0e6a4..8b50350fabb 100644
--- a/src/mesa/state_tracker/st_cb_viewport.c
+++ b/src/mesa/state_tracker/st_cb_viewport.c
@@ -54,9 +54,9 @@ static void st_viewport(struct gl_context *ctx)
stdraw = st_ws_framebuffer(st->ctx->DrawBuffer);
stread = st_ws_framebuffer(st->ctx->ReadBuffer);
- if (stdraw && stdraw->iface)
+ if (stdraw)
stdraw->iface_stamp = p_atomic_read(&stdraw->iface->stamp) - 1;
- if (stread && stread != stdraw && stread->iface)
+ if (stread && stread != stdraw)
stread->iface_stamp = p_atomic_read(&stread->iface->stamp) - 1;
}
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 2ba7de6c634..90e4177f696 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -176,10 +176,6 @@ st_framebuffer_validate(struct st_framebuffer *stfb,
boolean changed = FALSE;
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;
@@ -281,9 +277,6 @@ st_framebuffer_add_renderbuffer(struct st_framebuffer *stfb,
enum pipe_format format;
boolean sw;
- if (!stfb->iface)
- return FALSE;
-
assert(_mesa_is_winsys_fbo(&stfb->Base));
/* do not distinguish depth/stencil buffers */