[gtk+/gtk-3-16] x11/gl: Fix use after free



commit b52654b03db0c1cfb9a1add61e727e89c6f2ad42
Author: Olivier Fourdan <fourdan xfce org>
Date:   Fri Apr 3 17:51:57 2015 +0200

    x11/gl: Fix use after free
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747305
    
    Signed-off-by: Olivier Fourdan <fourdan xfce org>

 gdk/x11/gdkglcontext-x11.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index fdf8ab2..0ce0789 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -309,9 +309,9 @@ glx_pixmap_get (cairo_surface_t *surface, guint texture_target)
 {
   Display *display = cairo_xlib_surface_get_display (surface);
   Screen *screen = cairo_xlib_surface_get_screen (surface);
-  Visual *visual = cairo_xlib_surface_get_visual (surface);;
+  Visual *visual = cairo_xlib_surface_get_visual (surface);
   GdkGLXPixmap *glx_pixmap;
-  GLXFBConfig *fbconfigs;
+  GLXFBConfig *fbconfigs, config;
   int nfbconfigs;
   XVisualInfo *visinfo;
   VisualID visualid;
@@ -393,6 +393,7 @@ glx_pixmap_get (cairo_surface_t *surface, guint texture_target)
       if (value == TRUE)
         y_inverted = TRUE;
 
+      config = fbconfigs[i];
       break;
     }
 
@@ -407,7 +408,7 @@ glx_pixmap_get (cairo_surface_t *surface, guint texture_target)
   glx_pixmap = g_slice_new0 (GdkGLXPixmap);
   glx_pixmap->y_inverted = y_inverted;
   glx_pixmap->display = display;
-  glx_pixmap->drawable = glXCreatePixmap (display, fbconfigs[i],
+  glx_pixmap->drawable = glXCreatePixmap (display, config,
                                          cairo_xlib_surface_get_drawable (surface),
                                          pixmap_attributes);
 


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