aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJohn Stebbins <jstebbins@jetheaddev.com>2020-04-04 14:52:00 -0600
committerPhilip Langdale <philipl@overt.org>2020-04-10 09:32:13 -0700
commita129cc9e2942d9185a23726fd88b074e453e859a (patch)
treed2580b7278dd2a28535bd89e7104b0f6e19b6012 /libavcodec
parent1bf0df4c4f52df044b57ff477418cae9c24820f8 (diff)
downloadffmpeg-a129cc9e2942d9185a23726fd88b074e453e859a.tar.gz
lavc/movtextenc: fix unclosed style records
The last record at the end of each dialog was never closed Signed-off-by: Philip Langdale <philipl@overt.org>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/movtextenc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index 05532cd544..d389111419 100644
--- a/libavcodec/movtextenc.c
+++ b/libavcodec/movtextenc.c
@@ -309,6 +309,12 @@ static void mov_text_color_cb(void *priv, unsigned int color, unsigned int color
*/
}
+static void mov_text_end_cb(void *priv)
+{
+ // End of text, close any open style record
+ mov_text_style_start((MovTextContext*)priv);
+}
+
static uint16_t utf8_strlen(const char *text, int len)
{
uint16_t i = 0, ret = 0;
@@ -352,6 +358,7 @@ static const ASSCodesCallbacks mov_text_callbacks = {
.new_line = mov_text_new_line_cb,
.style = mov_text_style_cb,
.color = mov_text_color_cb,
+ .end = mov_text_end_cb,
};
static int mov_text_encode_frame(AVCodecContext *avctx, unsigned char *buf,