summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-12 16:50:28 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-08-12 16:50:28 -0400
commit1e53d4d5904445c740a374ea8492935f95bf1654 (patch)
tree7b6af22708c713d90e0a9aa4be245238ffe56b34
parent141dfa186403bb22e1e3875fdc263d402b2abb1d (diff)
downloadpango-1e53d4d5904445c740a374ea8492935f95bf1654.tar.gz
[HB] Always clear positions if dirty, before returning to user
-rw-r--r--pango/opentype/hb-buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pango/opentype/hb-buffer.c b/pango/opentype/hb-buffer.c
index 94b8a5b7..93b51e5c 100644
--- a/pango/opentype/hb-buffer.c
+++ b/pango/opentype/hb-buffer.c
@@ -374,7 +374,7 @@ hb_buffer_get_glyph_infos (hb_buffer_t *buffer)
hb_glyph_position_t *
hb_buffer_get_glyph_positions (hb_buffer_t *buffer)
{
- if (buffer->in_length && !buffer->positions)
+ if (buffer->have_output || (buffer->in_length && !buffer->positions))
hb_buffer_clear_positions (buffer);
return (hb_glyph_position_t *) buffer->positions;
@@ -435,7 +435,7 @@ hb_utf8_next (const uint8_t *text,
unsigned int mask, len;
UTF8_COMPUTE (c, mask, len);
- if (HB_UNLIKELY (!len || end - text < len)) {
+ if (HB_UNLIKELY (!len || (unsigned int) (end - text) < len)) {
*unicode = -1;
return text + 1;
} else {