mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-04 22:50:24 +00:00
avfilter/vf_drawtext: fix newline rendered as .notdef glyph
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 <info@scriptit.uk>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
(cherry picked from commit fd9f1e9c52)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
6444eb4b57
commit
864d4bf2da
1 changed files with 2 additions and 1 deletions
|
|
@ -1451,13 +1451,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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue