[dia/dia-0-96] [merged from git diff {b6f5ba3, 232ccfa} > rev-3739.diff]



commit 7f193452ab007e3db81d3dcef371575a461b4788
Author: Hans Breuer <hans breuer org>
Date:   Mon Apr 13 15:18:07 2009 +0200

    [merged from git diff {b6f5ba3,232ccfa} > rev-3739.diff]
    
    2007-08-07  Steffen Macke <sdteffen gmail com>
    
    * lib/font.c: get_string_offsets() Don't crash when line length is 0
    fixes bug #450040
---
 ChangeLog  |    6 ++++++
 lib/font.c |   12 ++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5e17295..ba288d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,12 @@
 	* app/diagram.c(diagram_load) : don't kill the default diagram on 
 	import failure. Fixes bug #490546
 
+[merged from git diff {b6f5ba3,232ccfa} > rev-3739.diff]
+2007-08-07  Steffen Macke <sdteffen gmail com>
+
+	* lib/font.c: get_string_offsets() Don't crash when line length is 0
+	fixes bug #450040
+
 [merged from git diff {0324dff,d5ca7c7} > rev-3735.diff]
 2007-08-05  Hans Breuer  <hans breuer org>
 
diff --git a/lib/font.c b/lib/font.c
index ab71f12..cf78021 100644
--- a/lib/font.c
+++ b/lib/font.c
@@ -611,8 +611,16 @@ get_string_offsets(PangoLayoutIter *iter, real** offsets, int* n_offsets)
 {
   int i;
   PangoLayoutLine*   line = pango_layout_iter_get_line(iter);
-  PangoGlyphItem* item = (PangoGlyphItem*)line->runs->data;
-  PangoGlyphString* string = item->glyphs;
+  PangoGlyphItem* item;
+  PangoGlyphString* string;
+
+  if(0 == line->length)
+  {
+    *n_offsets = 0;
+    return;
+  }
+  item = (PangoGlyphItem*)line->runs->data;
+  string = item->glyphs;
 
   *n_offsets = string->num_glyphs;
   *offsets = g_new(real, *n_offsets);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]