Message ID | 20200406175218.1299994-7-jstebbins@jetheaddev.com |
---|---|
State | Accepted |
Commit | c0d3fea6000bae5937df6f5744e1dfdd3ab83795 |
Headers | show |
Series | [FFmpeg-devel,01/23] lavc/movtextdec: fix ass header colors | expand |
Context | Check | Description |
---|---|---|
andriy/ffmpeg-patchwork | success | Make fate finished |
On Mon, 6 Apr 2020 11:52:01 -0600 John Stebbins <jstebbins@jetheaddev.com> wrote: > --- > libavcodec/movtextdec.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c > index 6c7d93702e..2481c71af6 100644 > --- a/libavcodec/movtextdec.c > +++ b/libavcodec/movtextdec.c > @@ -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; LGTM. --phil
diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index 6c7d93702e..2481c71af6 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -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;