From 4ee803b42a3baae4b0f295a07cb7ad591a538e4c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 27 Feb 2013 16:09:55 -0500 Subject: [PATCH] [buffer] Fix serializing of buffer with invalid direction --- src/hb-buffer-serialize.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-buffer-serialize.cc b/src/hb-buffer-serialize.cc index d7c92c6ab..c1e2fcecb 100644 --- a/src/hb-buffer-serialize.cc +++ b/src/hb-buffer-serialize.cc @@ -174,7 +174,7 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer, p += snprintf (p, ARRAY_LENGTH (b) - (p - b), "@%d,%d", pos[i].x_offset, pos[i].y_offset); *p++ = '+'; - if (HB_DIRECTION_IS_HORIZONTAL (direction) || pos[i].x_advance) + if (!HB_DIRECTION_IS_VERTICAL (direction) || pos[i].x_advance) p += snprintf (p, ARRAY_LENGTH (b) - (p - b), "%d", pos[i].x_advance); if (HB_DIRECTION_IS_VERTICAL (direction) || pos->y_advance) p += snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_advance);