URL:
  <http://gna.org/bugs/?25529>

                 Summary: gtk-3.22 client crashes when clicking on single
active unit [with potential fix]
                 Project: Freeciv
            Submitted by: jochent
            Submitted on: Mon 20 Feb 2017 10:03:26 AM UTC
                Category: client-gtk-3.22
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: S3_0
         Discussion Lock: Any
        Operating System: None
         Planned Release: 
 Contains string changes: None

    _______________________________________________________

Details:

To reproduce the crash: 

start a new game in the gtk-3.22 client, move all units except the last one
(i.e., you have a unit on a tile all by itself and active with the funny
rotating cursor around it), click on the active unit -> crash

I can make it crash reliably by activating any unit that is by itself on a
tile (click once so that the rotating cursor appears)and then click it again
-> crash

The cause:

line 537 in client/gui-gtk-3.22/mapview.c has the call

ctx = gdk_window_begin_draw_frame(pixmap, NULL);

and then

cr = gdk_drawing_context_get_cairo_context(ctx);

This crashes inside cairo (the libgdk function calls INT_cairo_region_union
with second argument NULL and that triggers a null pointer dereference).

The potential fix:

It appears that gdk_window_begin_draw_frame must be called with a valid clip
region in its second argument. I tried

ctx = gdk_window_begin_draw_frame(pixmap,
gdk_window_get_clip_region(pixmap));

and that seems to work but I have no idea if it the right thing to be doing.




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?25529>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to