From 9440a5e94548392841ff03121b7513259d81639f Mon Sep 17 00:00:00 2001
From: Kenichi Ishibashi <bashi@chromium.org>
Date: Wed, 19 Oct 2011 19:08:52 +0900
Subject: [PATCH] Make sure buffer size in replace_glyph()

---
 src/hb-buffer.cc |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index 3e25b15..e8bdfb1 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -317,6 +317,8 @@ hb_buffer_t::copy_glyph (void)
 void
 hb_buffer_t::replace_glyph (hb_codepoint_t glyph_index)
 {
+  if (!make_room_for (1, 1)) return;
+
   out_info[out_len] = info[idx];
   out_info[out_len].codepoint = glyph_index;
 
-- 
1.7.5.4

