mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 17:50:11 +01:00
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: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 136c437cea)
This commit is contained in:
parent
5d680bc082
commit
e19c702eac
1 changed files with 6 additions and 1 deletions
|
|
@ -182,8 +182,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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue