dri3: initialize adaptive_sync as false before configQueryb
authorTapani Pälli <tapani.palli@intel.com>
Mon, 7 Jan 2019 08:52:56 +0000 (10:52 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Tue, 8 Jan 2019 06:15:07 +0000 (08:15 +0200)
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 <tapani.palli@intel.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
src/loader/loader_dri3_helper.c

index 5c48da93e6aa62db19ee0fec023405b7f67d0e2d..20fe4cbdabc118e87ee24e0741555dbb3ed5b08e 100644 (file)
@@ -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);