mirror of
https://github.com/yshui/picom.git
synced 2024-11-11 13:51:02 -05:00
backend: gl: fix use-after-scope
'format' was pointing to an array with a shorter lifetime suggested by @tryone144 Co-authored-by: Bernd Busse <bernd@busse-net.de>
This commit is contained in:
parent
d38b0ead7d
commit
236c8228b8
1 changed files with 2 additions and 4 deletions
|
@ -919,10 +919,8 @@ bool gl_init(struct gl_data *gd, session_t *ps) {
|
||||||
// Set up the size and format of the back texture
|
// Set up the size and format of the back texture
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, gd->back_fbo);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, gd->back_fbo);
|
||||||
glDrawBuffer(GL_COLOR_ATTACHMENT0);
|
glDrawBuffer(GL_COLOR_ATTACHMENT0);
|
||||||
const GLint *format = (const GLint[]){GL_RGB8, GL_RGBA8};
|
const GLint *format = gd->dithered_present ? (const GLint[]){GL_RGB16, GL_RGBA16}
|
||||||
if (gd->dithered_present) {
|
: (const GLint[]){GL_RGB8, GL_RGBA8};
|
||||||
format = (const GLint[]){GL_RGB16, GL_RGBA16};
|
|
||||||
}
|
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
gd->back_format = format[i];
|
gd->back_format = format[i];
|
||||||
gl_resize(gd, ps->root_width, ps->root_height);
|
gl_resize(gd, ps->root_width, ps->root_height);
|
||||||
|
|
Loading…
Reference in a new issue