Leave one extra item at the end of buffer allocation
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 18 Jul 2012 19:43:55 +0000 (15:43 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 18 Jul 2012 19:43:55 +0000 (15:43 -0400)
Just in case, for the times we do out-of-bounds access.

jk

src/hb-buffer-private.hh

index 9bd80e0..e06a7fa 100644 (file)
@@ -148,7 +148,7 @@ struct hb_buffer_t {
   HB_INTERNAL bool enlarge (unsigned int size);
 
   inline bool ensure (unsigned int size)
-  { return likely (size <= allocated) ? true : enlarge (size); }
+  { return likely (size < allocated) ? true : enlarge (size); }
 
   HB_INTERNAL bool make_room_for (unsigned int num_in, unsigned int num_out);