[mutter/wip/carlosg/fix-multimonitor-buffer-age: 2/2] cogl/egl: Explicitly initialize age variable



commit 335cce39f922f69ae6c182c8bfd9fc59b5ccfd29
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Oct 30 14:17:04 2019 +0100

    cogl/egl: Explicitly initialize age variable
    
    In case of error, it's untouched by EGL, which probably means an
    invalid read.

 cogl/cogl/winsys/cogl-winsys-egl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/cogl/cogl/winsys/cogl-winsys-egl.c b/cogl/cogl/winsys/cogl-winsys-egl.c
index f6aab6b30..8c324386f 100644
--- a/cogl/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/cogl/winsys/cogl-winsys-egl.c
@@ -697,7 +697,7 @@ _cogl_winsys_onscreen_get_buffer_age (CoglOnscreen *onscreen)
   CoglDisplayEGL *egl_display = context->display->winsys;
   EGLSurface surface = egl_onscreen->egl_surface;
   static gboolean warned = FALSE;
-  int age;
+  int age = 0;
 
   if (!(egl_renderer->private_features & COGL_EGL_WINSYS_FEATURE_BUFFER_AGE))
     return 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]