mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
render/gles2: prevent imported DMA-BUF textures from being mutated
The compositor shouldn't write to client buffers if the client attaches a DMA-BUF to a wl_surface, then attaches a shm buffer. Make gles2_texture_write_pixels return an error to prevent this from happening.
This commit is contained in:
parent
1e5460d4c6
commit
004cf887b7
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ static bool gles2_texture_write_pixels(struct wlr_texture *wlr_texture,
|
||||||
const void *data) {
|
const void *data) {
|
||||||
struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture);
|
struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture);
|
||||||
|
|
||||||
if (texture->target != GL_TEXTURE_2D) {
|
if (texture->target != GL_TEXTURE_2D || texture->image != EGL_NO_IMAGE_KHR) {
|
||||||
wlr_log(WLR_ERROR, "Cannot write pixels to immutable texture");
|
wlr_log(WLR_ERROR, "Cannot write pixels to immutable texture");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue