summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2020-10-19 03:41:27 +0300
committerOleg Oshmyan <chortos@inbox.lv>2020-10-19 20:36:18 +0300
commit5ed41221d80484859cfe33f3a0e09d3462d195bd (patch)
tree3ac1ee207d9beff7784d7b599869ae0c4c4a94d7
parent80ce6378d572c230923bfc239f679e8604b8448a (diff)
downloadlibass-5ed41221d80484859cfe33f3a0e09d3462d195bd.tar.bz2
libass-5ed41221d80484859cfe33f3a0e09d3462d195bd.tar.xz
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.
-rw-r--r--libass/ass_shaper.c11
1 files 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 ||