[pango] Bug 628497 - Crash in pango_layout_line_get_extents at pango-layout.c
- From: Behdad Esfahbod <behdad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] Bug 628497 - Crash in pango_layout_line_get_extents at pango-layout.c
- Date: Tue, 28 Sep 2010 01:08:23 +0000 (UTC)
commit 47ba8cfcb857d62f15f4df58d5d5c7bd5088a107
Author: Behdad Esfahbod <behdad behdad org>
Date: Mon Sep 27 21:07:34 2010 -0400
Bug 628497 - Crash in pango_layout_line_get_extents at pango-layout.c
Cleanup LINE_IS_VALID() usage.
pango/pango-layout.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index c60c7e8..4cf00a1 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -133,7 +133,7 @@ struct _PangoLayoutClass
};
-#define LINE_IS_VALID(line) ((line)->layout != NULL)
+#define LINE_IS_VALID(line) ((line) && (line)->layout != NULL)
#ifdef G_DISABLE_CHECKS
#define ITER_IS_INVALID(iter) FALSE
@@ -3987,12 +3987,8 @@ pango_layout_line_x_to_index (PangoLayoutLine *line,
gint last_trailing;
gboolean suppress_last_trailing;
- g_return_val_if_fail (line != NULL, FALSE);
g_return_val_if_fail (LINE_IS_VALID (line), FALSE);
- if (!LINE_IS_VALID (line))
- return FALSE;
-
layout = line->layout;
/* Find the last index in the line
@@ -4557,9 +4553,6 @@ pango_layout_line_get_extents (PangoLayoutLine *line,
g_return_if_fail (LINE_IS_VALID (line));
- if (!LINE_IS_VALID (line))
- return;
-
if (G_UNLIKELY (!ink_rect && !logical_rect))
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]