[libgnomekbd] libgnomekbd/gkbd-keyboard-drawing.c: fix a segfault
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgnomekbd] libgnomekbd/gkbd-keyboard-drawing.c: fix a segfault
- Date: Fri, 22 Jan 2016 15:59:43 +0000 (UTC)
commit 1ae17df45b629441f5aa7ed946616b0a17e26dbf
Author: Antonio Ospite <ao2 ao2 it>
Date: Fri Jan 22 11:46:39 2016 +0100
libgnomekbd/gkbd-keyboard-drawing.c: fix a segfault
When drawing the keyboard without having set the groups and levels there
is a segmentation fault:
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe49ae8c9 in draw_key_label (is_pressed=<optimized out>, xkb_height=<optimized out>,
xkb_width=<optimized out>, xkb_origin_y=<optimized out>,
xkb_origin_x=<optimized out>, angle=0, keycode=<optimized out>, drawing=0xa540e0, context=0xca6080)
at gkbd-keyboard-drawing.c:1017
1017 if (drawing->groupLevels[glp] == NULL)
Fix that.
The widget now is able to draw a keyboard without the keys labels, which
can be useful when testing just the keyboard geometry.
https://bugzilla.gnome.org/show_bug.cgi?id=760988
libgnomekbd/gkbd-keyboard-drawing.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libgnomekbd/gkbd-keyboard-drawing.c b/libgnomekbd/gkbd-keyboard-drawing.c
index cf32d57..9b8dae3 100644
--- a/libgnomekbd/gkbd-keyboard-drawing.c
+++ b/libgnomekbd/gkbd-keyboard-drawing.c
@@ -1000,7 +1000,7 @@ draw_key_label (GkbdKeyboardDrawingRenderContext * context,
gint padding;
gint g, l, glp;
- if (!drawing->xkb || keycode == INVALID_KEYCODE)
+ if (!drawing->xkb || !drawing->groupLevels || keycode == INVALID_KEYCODE)
return;
padding = 23 * context->scale_numerator / context->scale_denominator; /* 2.3mm */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]