messenger-gtk

Gtk+3 graphical user interfaces for GNUnet Messenger
Log | Files | Refs | Submodules | README | LICENSE

commit f6096c1762cffc7ee23f70dbdb70b79a90b1c4e1
parent 790193d7f837b75b9f932b0ca313dacce3c005f9
Author: TheJackiMonster <thejackimonster@gmail.com>
Date:   Mon, 14 Nov 2022 02:30:15 +0100

Fix potential crash by unsafe gst pipeline and improve unicode character handling

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>

Diffstat:
Msrc/ui/new_contact.c | 6++++++
Msrc/ui/picker.c | 4++++
2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/ui/new_contact.c b/src/ui/new_contact.c @@ -176,6 +176,9 @@ _setup_gst_pipeline(UI_NEW_CONTACT_Handle *handle) NULL ); + if (!(handle->pipeline)) + return; + handle->source = gst_bin_get_by_name( GST_BIN(handle->pipeline), "source" ); @@ -190,6 +193,9 @@ _setup_gst_pipeline(UI_NEW_CONTACT_Handle *handle) GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(handle->pipeline)); + if (!bus) + return; + gst_bus_add_signal_watch(bus); g_signal_connect( diff --git a/src/ui/picker.c b/src/ui/picker.c @@ -51,10 +51,14 @@ _add_emoji_buttons(GtkFlowBox *flow_box, GString *string = g_string_new(""); g_string_append_unichar(string, (gunichar) characters[i]); + gchar *_text = g_locale_to_utf8(string->str, string->len, NULL, NULL, NULL); + GtkButton *emoji_button = GTK_BUTTON( gtk_button_new_with_label(string->str) ); + g_free(_text); + gtk_button_set_relief(emoji_button, GTK_RELIEF_NONE); g_signal_connect(