[gtk+/gtk-3-16] Fix use-after-free in gdk_window_end_paint()



commit d041ff409a8b644f1062152745d1989889366bdc
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Thu Apr 30 20:43:18 2015 +0000

    Fix use-after-free in gdk_window_end_paint()
    
    It's a miracle that this code ever worked.

 gdk/gdkwindow.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 8c85cb7..65db5e8 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -3111,7 +3111,6 @@ gdk_window_end_paint (GdkWindow *window)
         {
           surface = gdk_window_ref_impl_surface (window);
           cr = cairo_create (surface);
-          cairo_surface_destroy (surface);
 
           cairo_set_source_surface (cr, window->current_paint.surface, 0, 0);
           gdk_cairo_region (cr, window->current_paint.region);
@@ -3123,6 +3122,7 @@ gdk_window_end_paint (GdkWindow *window)
           cairo_destroy (cr);
 
           cairo_surface_flush (surface);
+          cairo_surface_destroy (surface);
         }
     }
 


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