From 8465a05a89742295d4b009a9b4442eb0a899fd80 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 30 Nov 2012 08:46:43 +0200 Subject: [PATCH] Fix hb_buffer_guess_segment_properties() for empty buffer Was causing assertion failure in shape_plan(). --- src/hb-buffer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 0f5a97f15..0a5600be0 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -493,8 +493,8 @@ hb_buffer_t::merge_out_clusters (unsigned int start, void hb_buffer_t::guess_segment_properties (void) { - if (unlikely (!len)) return; - assert (content_type == HB_BUFFER_CONTENT_TYPE_UNICODE); + assert (content_type == HB_BUFFER_CONTENT_TYPE_UNICODE || + (!len && content_type == HB_BUFFER_CONTENT_TYPE_INVALID)); /* If script is set to INVALID, guess from buffer contents */ if (props.script == HB_SCRIPT_INVALID) {