mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avcodec/movtextdec: Avoid loop when writing UTF-8 character to AVBPrint
Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
c84a91eff7
commit
ba795890ec
@ -430,7 +430,6 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end,
|
|||||||
av_log(avctx, AV_LOG_ERROR, "invalid UTF-8 byte in subtitle\n");
|
av_log(avctx, AV_LOG_ERROR, "invalid UTF-8 byte in subtitle\n");
|
||||||
len = 1;
|
len = 1;
|
||||||
}
|
}
|
||||||
for (i = 0; i < len; i++) {
|
|
||||||
switch (*text) {
|
switch (*text) {
|
||||||
case '\r':
|
case '\r':
|
||||||
break;
|
break;
|
||||||
@ -438,11 +437,10 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end,
|
|||||||
av_bprintf(buf, "\\N");
|
av_bprintf(buf, "\\N");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
av_bprint_chars(buf, *text, 1);
|
av_bprint_append_data(buf, text, len);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
text++;
|
text += len;
|
||||||
}
|
|
||||||
text_pos++;
|
text_pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user