--- ./pango/break.c.orig	2005-08-18 13:19:06.000000000 -0400
+++ ./pango/break.c	2005-08-18 12:39:15.000000000 -0400
@@ -328,6 +328,8 @@
   INDEX_WORD_JOINER
 };
 
+#define BREAK_TYPE_SAFE(btype)            \
+         (btype < G_N_ELEMENTS(line_break_indexes) ? btype : G_UNICODE_BREAK_UNKNOWN)
 #define BREAK_INDEX(btype)                \
          (line_break_indexes[(btype)])
 #define BREAK_ROW(before_type)            \
@@ -335,7 +337,7 @@
 #define BREAK_OP(before_type, after_type) \
          (BREAK_ROW (before_type)[BREAK_INDEX (after_type)])
 #define IN_BREAK_TABLE(btype)             \
-         (btype <= G_N_ELEMENTS(line_break_indexes) && BREAK_INDEX(btype) < INDEX_END_OF_TABLE)
+         (btype < G_N_ELEMENTS(line_break_indexes) && BREAK_INDEX(btype) < INDEX_END_OF_TABLE)
 
 /* Keep these in sync with the same macros in the test program */
 
@@ -491,6 +493,7 @@
     next_wc = '\n';
 
   next_break_type = g_unichar_break_type (next_wc);
+  next_break_type = BREAK_TYPE_SAFE (next_break_type);
 
   for (i = 0; i <= n_chars; i++)
     {
@@ -529,6 +532,7 @@
             }
 	  
 	  next_break_type = g_unichar_break_type (next_wc);
+          next_break_type = BREAK_TYPE_SAFE (next_break_type);
         }
 
       type = g_unichar_type (wc);
