Set buffer content type to INVALID in hb_buffer_set_length(0)
Previously we were only setting this in hb_buffer_clear_contents(),
but set_length(0) is a valid way to reinitialize buffer to use with
new text.
diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh
index d3ed449..49773f1 100644
--- a/src/hb-buffer-private.hh
+++ b/src/hb-buffer-private.hh
@@ -181,7 +181,7 @@
HB_INTERNAL bool enlarge (unsigned int size);
inline bool ensure (unsigned int size)
- { return likely (size < allocated) ? true : enlarge (size); }
+ { return likely (!size || size < allocated) ? true : enlarge (size); }
HB_INTERNAL bool make_room_for (unsigned int num_in, unsigned int num_out);
HB_INTERNAL bool shift_forward (unsigned int count);