From: Zhao Zhili <[email protected]> GET_UTF8 advances the pointer past the newline byte before the newline check, so shape_text_hb receives text that includes the newline character. Since HarfBuzz does not treat U+000A as default-ignorable, it gets shaped into a .notdef glyph.
Fixes #21565 Reported-by: scriptituk <[email protected]> Signed-off-by: Zhao Zhili <[email protected]> --- libavfilter/vf_drawtext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 2812de37f56..d2d3bd8f693 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -1452,13 +1452,14 @@ continue_on_failed: s->tab_clusters[tab_idx++] = i; *p = ' '; } + size_t len = p - start; GET_UTF8(code, *p ? *p++ : 0, code = 0xfffd; goto continue_on_failed2;); continue_on_failed2: if (ff_is_newline(code) || code == 0) { TextLine *cur_line = &s->lines[line_count]; HarfbuzzData *hb = &cur_line->hb_data; cur_line->cluster_offset = line_offset; - ret = shape_text_hb(s, hb, start, p - start); + ret = shape_text_hb(s, hb, start, len); if (ret != 0) { goto done; } -- 2.51.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
