mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
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@olsak@amd.com> (v2)
This commit is contained in:
parent
19b61799e3
commit
9d346af322
2 changed files with 2 additions and 9 deletions
|
|
@ -54,9 +54,9 @@ static void st_viewport(struct gl_context *ctx)
|
||||||
stdraw = st_ws_framebuffer(st->ctx->DrawBuffer);
|
stdraw = st_ws_framebuffer(st->ctx->DrawBuffer);
|
||||||
stread = st_ws_framebuffer(st->ctx->ReadBuffer);
|
stread = st_ws_framebuffer(st->ctx->ReadBuffer);
|
||||||
|
|
||||||
if (stdraw && stdraw->iface)
|
if (stdraw)
|
||||||
stdraw->iface_stamp = p_atomic_read(&stdraw->iface->stamp) - 1;
|
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;
|
stread->iface_stamp = p_atomic_read(&stread->iface->stamp) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,10 +176,6 @@ st_framebuffer_validate(struct st_framebuffer *stfb,
|
||||||
boolean changed = FALSE;
|
boolean changed = FALSE;
|
||||||
int32_t new_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);
|
new_stamp = p_atomic_read(&stfb->iface->stamp);
|
||||||
if (stfb->iface_stamp == new_stamp)
|
if (stfb->iface_stamp == new_stamp)
|
||||||
return;
|
return;
|
||||||
|
|
@ -281,9 +277,6 @@ st_framebuffer_add_renderbuffer(struct st_framebuffer *stfb,
|
||||||
enum pipe_format format;
|
enum pipe_format format;
|
||||||
boolean sw;
|
boolean sw;
|
||||||
|
|
||||||
if (!stfb->iface)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
assert(_mesa_is_winsys_fbo(&stfb->Base));
|
assert(_mesa_is_winsys_fbo(&stfb->Base));
|
||||||
|
|
||||||
/* do not distinguish depth/stencil buffers */
|
/* do not distinguish depth/stencil buffers */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue