summaryrefslogtreecommitdiff
path: root/pango/pango-ot-buffer.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-11-17 16:20:42 -0500
committerBehdad Esfahbod <behdad@behdad.org>2009-11-17 16:21:11 -0500
commit4ccabeffc20f899163bf610356871afb197e9bf8 (patch)
tree629478f89f68fc763f55cbc53bd8d1d25160c610 /pango/pango-ot-buffer.c
parent718c533d28cb760e45c7b874420b14003445a9c1 (diff)
downloadpango-4ccabeffc20f899163bf610356871afb197e9bf8.tar.gz
Bug 596614 - Pango application receives SIGSEGV on pasting text with U+202E
Fixed all modules to reverse glyphs if run is rtl. Except for Hangul module. Fixed pango_shape() to detect that, warn, and reverse.
Diffstat (limited to 'pango/pango-ot-buffer.c')
-rw-r--r--pango/pango-ot-buffer.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/pango/pango-ot-buffer.c b/pango/pango-ot-buffer.c
index a4aacc3a..533c3102 100644
--- a/pango/pango-ot-buffer.c
+++ b/pango/pango-ot-buffer.c
@@ -23,6 +23,7 @@
#include "pango-ot-private.h"
#include "pangofc-private.h"
+#include "pango-impl-utils.h"
/* cache a single hb_buffer_t */
static hb_buffer_t *cached_buffer = NULL;
@@ -204,26 +205,6 @@ pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer,
}
static void
-swap_range (PangoGlyphString *glyphs, int start, int end)
-{
- int i, j;
-
- for (i = start, j = end - 1; i < j; i++, j--)
- {
- PangoGlyphInfo glyph_info;
- gint log_cluster;
-
- glyph_info = glyphs->glyphs[i];
- glyphs->glyphs[i] = glyphs->glyphs[j];
- glyphs->glyphs[j] = glyph_info;
-
- log_cluster = glyphs->log_clusters[i];
- glyphs->log_clusters[i] = glyphs->log_clusters[j];
- glyphs->log_clusters[j] = log_cluster;
- }
-}
-
-static void
apply_gpos_ltr (PangoGlyphString *glyphs,
hb_glyph_position_t *positions,
gboolean is_hinted)
@@ -389,7 +370,7 @@ pango_ot_buffer_output (const PangoOTBuffer *buffer,
if (buffer->rtl)
{
/* Swap all glyphs */
- swap_range (glyphs, 0, glyphs->num_glyphs);
+ pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs);
}
positions = hb_buffer_get_glyph_positions (buffer->buffer);