]> git.sesse.net Git - ffmpeg/commitdiff
lavc/movtextdec: make sure default font name is set
authorJohn Stebbins <jstebbins@jetheaddev.com>
Sat, 4 Apr 2020 17:45:20 +0000 (11:45 -0600)
committerPhilip Langdale <philipl@overt.org>
Fri, 10 Apr 2020 16:32:13 +0000 (09:32 -0700)
Signed-off-by: Philip Langdale <philipl@overt.org>
libavcodec/movtextdec.c

index 6c7d93702e82780d610579cc8073bacb881fcb86..2481c71af696f472c93e0ec88a2169fec2bfe033 100644 (file)
@@ -52,7 +52,7 @@
 
 typedef struct {
     uint16_t fontID;
-    char *font;
+    const char *font;
     uint8_t fontsize;
     int color;
     int back_color;
@@ -251,6 +251,8 @@ static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
         m->ftab_temp = NULL;
         tx3g_ptr = tx3g_ptr + font_length;
     }
+    // In case of broken header, init default font
+    m->d.font = ASS_DEFAULT_FONT;
     for (i = 0; i < m->ftab_entries; i++) {
         if (m->d.fontID == m->ftab[i]->fontID)
             m->d.font = m->ftab[i]->font;