From 5ed41221d80484859cfe33f3a0e09d3462d195bd Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Mon, 19 Oct 2020 03:41:27 +0300 Subject: shaper: ensure drawings are in separate shape runs from text Previously, drawings would get shape_run_id = 0 from calloc. Most of the time, this separated them from text shape runs, but drawings immediately following the very first shape run would get appended to it. Make sure this cannot happen. --- libass/ass_shaper.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c index 4e93d2b..e07c0ca 100644 --- a/libass/ass_shaper.c +++ b/libass/ass_shaper.c @@ -782,12 +782,11 @@ void ass_shaper_find_runs(ASS_Shaper *shaper, ASS_Renderer *render_priv, for (i = 0; i < len; i++) { GlyphInfo *last = glyphs + i - 1; GlyphInfo *info = glyphs + i; - // skip drawings - if (info->drawing_text) - continue; - // set size and get glyph index - ass_font_get_index(render_priv->fontselect, info->font, - info->symbol, &info->face_index, &info->glyph_index); + if (!info->drawing_text) { + // set size and get glyph index + ass_font_get_index(render_priv->fontselect, info->font, + info->symbol, &info->face_index, &info->glyph_index); + } if (i > 0 && (last->font != info->font || last->face_index != info->face_index || last->script != info->script || -- cgit v1.2.3