diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-08-21 19:08:32 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-21 19:09:52 -0400 |
commit | b823774b132e1cddd6e4a8a423761c5c15375753 (patch) | |
tree | bf704cadf11e946d8b6d93e5c867983049e12e09 | |
parent | f72ff7d4752318b48e3dd0db83a2ef0300aa898f (diff) | |
download | pango-b823774b132e1cddd6e4a8a423761c5c15375753.tar.gz |
renderer: Don't divide by zerorenderer-crash
Before dividing by num_glyphs in draw_strikethrough,
make sure it isn't 0. This should fix reported crashes
in this function.
Fixes: #599
-rw-r--r-- | pango/pango-renderer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c index f575707f..21d09573 100644 --- a/pango/pango-renderer.c +++ b/pango/pango-renderer.c @@ -284,7 +284,7 @@ draw_strikethrough (PangoRenderer *renderer, PangoRectangle *rect = &state->strikethrough_rect; int num_glyphs = state->strikethrough_glyphs; - if (state->strikethrough) + if (state->strikethrough && num_glyphs > 0) pango_renderer_draw_rectangle (renderer, PANGO_RENDER_PART_STRIKETHROUGH, rect->x, |