[pango/pango-1-48] renderer: Don't divide by zero
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/pango-1-48] renderer: Don't divide by zero
- Date: Wed, 25 Aug 2021 12:30:18 +0000 (UTC)
commit 71e39443b5e97fd5e8952c42369c9f59b3f393e3
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Aug 21 19:08:32 2021 -0400
renderer: Don't divide by zero
Before dividing by num_glyphs in draw_strikethrough,
make sure it isn't 0. This should fix reported crashes
in this function.
Fixes: #599
pango/pango-renderer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]