Problem: GTK4: using uninitialised colors in gui_mch_init()
Solution: Use g_new0() instead of g_new() (Yasuhiro Matsumoto)
gui.fgcolor/bgcolor/spcolor were allocated with g_new(), leaving the
GdkRGBA fields uninitialised. On widget realize/map GTK runs
gui_mch_new_colors() -> surface_fill_bg() before gui_mch_set_bg_color()
assigns them, so cairo_set_source_rgba() branched on uninitialised
values (reported by valgrind). Use g_new0() to zero-initialise.
closes: #20538
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
gui_mch_init(void)
{
// Allocate GdkRGBA color structs.
- gui.fgcolor = g_new(GdkRGBA, 1);
- gui.bgcolor = g_new(GdkRGBA, 1);
- gui.spcolor = g_new(GdkRGBA, 1);
+ gui.fgcolor = g_new0(GdkRGBA, 1);
+ gui.bgcolor = g_new0(GdkRGBA, 1);
+ gui.spcolor = g_new0(GdkRGBA, 1);
gui.def_norm_pixel = 0x00000000; // black
gui.def_back_pixel = 0x00ffffff; // white
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 654,
/**/
653,
/**/