|
@@ -1225,7 +1225,8 @@ static int draw_glyphs(DrawTextContext *s, AVFrame *frame,
|
|
|
for (i = 0, p = text; *p; i++) {
|
|
for (i = 0, p = text; *p; i++) {
|
|
|
FT_Bitmap bitmap;
|
|
FT_Bitmap bitmap;
|
|
|
Glyph dummy = { 0 };
|
|
Glyph dummy = { 0 };
|
|
|
- GET_UTF8(code, *p++, continue;);
|
|
|
|
|
|
|
+ GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid;);
|
|
|
|
|
+continue_on_invalid:
|
|
|
|
|
|
|
|
/* skip new line chars, just go to new line */
|
|
/* skip new line chars, just go to new line */
|
|
|
if (code == '\n' || code == '\r' || code == '\t')
|
|
if (code == '\n' || code == '\r' || code == '\t')
|
|
@@ -1363,7 +1364,8 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
|
|
|
|
|
|
|
|
/* load and cache glyphs */
|
|
/* load and cache glyphs */
|
|
|
for (i = 0, p = text; *p; i++) {
|
|
for (i = 0, p = text; *p; i++) {
|
|
|
- GET_UTF8(code, *p++, continue;);
|
|
|
|
|
|
|
+ GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid;);
|
|
|
|
|
+continue_on_invalid:
|
|
|
|
|
|
|
|
/* get glyph */
|
|
/* get glyph */
|
|
|
dummy.code = code;
|
|
dummy.code = code;
|
|
@@ -1386,7 +1388,8 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
|
|
|
/* compute and save position for each glyph */
|
|
/* compute and save position for each glyph */
|
|
|
glyph = NULL;
|
|
glyph = NULL;
|
|
|
for (i = 0, p = text; *p; i++) {
|
|
for (i = 0, p = text; *p; i++) {
|
|
|
- GET_UTF8(code, *p++, continue;);
|
|
|
|
|
|
|
+ GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid2;);
|
|
|
|
|
+continue_on_invalid2:
|
|
|
|
|
|
|
|
/* skip the \n in the sequence \r\n */
|
|
/* skip the \n in the sequence \r\n */
|
|
|
if (prev_code == '\r' && code == '\n')
|
|
if (prev_code == '\r' && code == '\n')
|