From: Tapani Pälli Date: Mon, 7 Jan 2019 08:52:56 +0000 (+0200) Subject: dri3: initialize adaptive_sync as false before configQueryb X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c292414765430b8030155021c95e2a713dd81a10;p=mesa.git dri3: initialize adaptive_sync as false before configQueryb Fixes following errors from valgrind output: ==23388== Conditional jump or move depends on uninitialised value(s) ==23388== at 0x48B4924: loader_dri3_drawable_init (loader_dri3_helper.c:381) ==23388== by 0x48A97D2: dri3_create_drawable (dri3_glx.c:386) ==23388== by 0x489E190: driFetchDrawable (dri_common.c:369) ==23388== by 0x48A9187: dri3_bind_context (dri3_glx.c:195) ==23388== by 0x488B75C: MakeContextCurrent (glxcurrent.c:220) ==23388== by 0x488B8DB: glXMakeCurrent (glxcurrent.c:267) ==23388== by 0x10A987: ??? (in /usr/bin/glxgears) ==23388== by 0x4BEB412: (below main) (in /usr/lib64/libc-2.28.so) ==23388== ==23388== Conditional jump or move depends on uninitialised value(s) ==23388== at 0x48B5A40: loader_dri3_swap_buffers_msc (loader_dri3_helper.c:923) ==23388== by 0x48A9B7E: dri3_swap_buffers (dri3_glx.c:587) ==23388== by 0x4887A81: glXSwapBuffers (glxcmds.c:857) ==23388== by 0x10ADED: ??? (in /usr/bin/glxgears) ==23388== by 0x4BEB412: (below main) (in /usr/lib64/libc-2.28.so) Fixes: 2e12fe425fe "loader/dri3: Enable adaptive_sync via _VARIABLE_REFRESH property" Signed-off-by: Tapani Pälli Reviewed-by: Michel Dänzer Reviewed-by: Nicholas Kazlauskas --- diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c index 5c48da93e6a..20fe4cbdabc 100644 --- a/src/loader/loader_dri3_helper.c +++ b/src/loader/loader_dri3_helper.c @@ -366,7 +366,7 @@ loader_dri3_drawable_init(xcb_connection_t *conn, cnd_init(&draw->event_cnd); if (draw->ext->config) { - unsigned char adaptive_sync; + unsigned char adaptive_sync = 0; draw->ext->config->configQueryi(draw->dri_screen, "vblank_mode", &vblank_mode);