diff mbox series

[FFmpeg-devel,03/23] lavc/movtextdec: fix bold, italic, underline flags

Message ID 20200406175218.1299994-4-jstebbins@jetheaddev.com
State Accepted
Commit 5f39f63a65ddea4198b6fc48b4da4f72144e28ed
Headers show
Series [FFmpeg-devel,01/23] lavc/movtextdec: fix ass header colors | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

John Stebbins April 6, 2020, 5:51 p.m. UTC
They should be 0 or 1 so that 0 or -1 is written to the ass header
---
 libavcodec/movtextdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Philip Langdale April 6, 2020, 9:47 p.m. UTC | #1
On Mon, 6 Apr 2020 11:51:58 -0600
John Stebbins <jstebbins@jetheaddev.com> wrote:

> They should be 0 or 1 so that 0 or -1 is written to the ass header
> ---
>  libavcodec/movtextdec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
> index 47a8401119..d6896562c2 100644
> --- a/libavcodec/movtextdec.c
> +++ b/libavcodec/movtextdec.c
> @@ -193,9 +193,9 @@ static int mov_text_tx3g(AVCodecContext *avctx,
> MovTextContext *m) tx3g_ptr += 2;
>      // face-style-flags
>      s_default.style_flag = *tx3g_ptr++;
> -    m->d.bold = s_default.style_flag & STYLE_FLAG_BOLD;
> -    m->d.italic = s_default.style_flag & STYLE_FLAG_ITALIC;
> -    m->d.underline = s_default.style_flag & STYLE_FLAG_UNDERLINE;
> +    m->d.bold = !!(s_default.style_flag & STYLE_FLAG_BOLD);
> +    m->d.italic = !!(s_default.style_flag & STYLE_FLAG_ITALIC);
> +    m->d.underline = !!(s_default.style_flag & STYLE_FLAG_UNDERLINE);
>      // fontsize
>      m->d.fontsize = *tx3g_ptr++;
>      // Primary color

LGTM.

--phil
diff mbox series

Patch

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 47a8401119..d6896562c2 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -193,9 +193,9 @@  static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
     tx3g_ptr += 2;
     // face-style-flags
     s_default.style_flag = *tx3g_ptr++;
-    m->d.bold = s_default.style_flag & STYLE_FLAG_BOLD;
-    m->d.italic = s_default.style_flag & STYLE_FLAG_ITALIC;
-    m->d.underline = s_default.style_flag & STYLE_FLAG_UNDERLINE;
+    m->d.bold = !!(s_default.style_flag & STYLE_FLAG_BOLD);
+    m->d.italic = !!(s_default.style_flag & STYLE_FLAG_ITALIC);
+    m->d.underline = !!(s_default.style_flag & STYLE_FLAG_UNDERLINE);
     // fontsize
     m->d.fontsize = *tx3g_ptr++;
     // Primary color