GNOME Bugzilla – Bug 744942
gdk:quartz: Avoid segfaulting when calling gdk_window_ensure_native
Last modified: 2015-02-22 18:45:16 UTC
Created attachment 297565 [details] [review] Fix the segfault avoid to dereference attributes when it is NULL and use the GdkWindow directly to get the window_type Currently calling gdk_window_ensure_native on a Drawing area leads to segfault because of a bug in _gdk_quartz_display_create_window_impl You can reproduce the segfault running playback-test from gst-plugins-base: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/tests/examples/playback I attach here a patch that fixes that issue (tested on mac OS 10.9 and Gtk 3.14.1)
Created attachment 297566 [details] [review] gdk/quartz: Fix mixup in attributes usage creating window implementation First, attributes can be NULL (which is always the case when calling gdk_window_ensure_native) so do not unconditionally dereference it. Then the window_type should be taken directly from the GdkWindow as in other backends (such as the X11 one for example).
Review of attachment 297566 [details] [review]: looks good to me.
(In reply to Emmanuele Bassi (:ebassi) from comment #2) > Review of attachment 297566 [details] [review] [review]: > > looks good to me. Should I just push it myself then? Also are you ok about cherry-pikcing it on the gtk-3.14 branch?
If you have the commit bit on git.gnome.org, feel free to push this commit. Cherry-picking to gtk-3-14 is also okay, from my side.
commit fb581a1084ed8949c6b8c666f07a3239153c03f6 Author: Thibault Saunier <tsaunier@gnome.org> Date: Sun Feb 22 13:01:17 2015 +0100 gdk/quartz: Fix mixup in attributes usage creating window implementation First, attributes can be NULL (which is always the case when calling gdk_window_ensure_native) so do not unconditionally dereference it. Then the window_type should be taken directly from the GdkWindow as in other backends (such as the X11 one for example). https://bugzilla.gnome.org/show_bug.cgi?id=744942