Fix hb_buffer_guess_segment_properties() for empty buffer

Was causing assertion failure in shape_plan().
This commit is contained in:
Behdad Esfahbod 2012-11-30 08:46:43 +02:00
parent e75943de80
commit 8465a05a89
1 changed files with 2 additions and 2 deletions

View File

@ -493,8 +493,8 @@ hb_buffer_t::merge_out_clusters (unsigned int start,
void void
hb_buffer_t::guess_segment_properties (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 script is set to INVALID, guess from buffer contents */
if (props.script == HB_SCRIPT_INVALID) { if (props.script == HB_SCRIPT_INVALID) {