Fix NULL pointer dereference in wxTextCtrl::GetStyle() with GTK3
Pointers in rgba array can be NULL.
This commit is contained in:
@@ -1882,8 +1882,10 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
|
|||||||
else // have custom attributes
|
else // have custom attributes
|
||||||
{
|
{
|
||||||
#ifdef __WXGTK3__
|
#ifdef __WXGTK3__
|
||||||
style.SetBackgroundColour(*pattr->appearance.rgba[0]);
|
if (GdkRGBA* rgba = pattr->appearance.rgba[0])
|
||||||
style.SetTextColour(*pattr->appearance.rgba[1]);
|
style.SetBackgroundColour(*rgba);
|
||||||
|
if (GdkRGBA* rgba = pattr->appearance.rgba[1])
|
||||||
|
style.SetTextColour(*rgba);
|
||||||
#else
|
#else
|
||||||
style.SetBackgroundColour(pattr->appearance.bg_color);
|
style.SetBackgroundColour(pattr->appearance.bg_color);
|
||||||
style.SetTextColour(pattr->appearance.fg_color);
|
style.SetTextColour(pattr->appearance.fg_color);
|
||||||
|
Reference in New Issue
Block a user