From 02e2f7dc56736ee03946ce764a76a7bca319db90 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 28 May 2015 23:42:14 -0400 Subject: [PATCH] Fix a cornercase crash If gtk_text_layout_move_cursor_visually is called with a count of 0, we were passing NULL to a free function that can't handle it. Don't do that. https://bugzilla.gnome.org/show_bug.cgi?id=750058 --- gtk/gtktextlayout.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index 00dbefae04..763ef3b7c8 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -3660,7 +3660,8 @@ gtk_text_layout_move_iter_visually (GtkTextLayout *layout, gtk_text_iter_backward_char (iter); } - gtk_text_layout_free_line_display (layout, display); + if (display) + gtk_text_layout_free_line_display (layout, display); done: