diff mbox series

[FFmpeg-devel,v3,1/8] avcodec/movtextenc: Fix potential use of uninitialized value

Message ID 20201017073745.403153-1-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,v3,1/8] avcodec/movtextenc: Fix potential use of uninitialized value | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 17, 2020, 7:37 a.m. UTC
Background colour was never initialized if no style was available.
Use a sane default of zero (i.e. completely transparent).

Fixes Coverity issue #1461471.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
No change for this patch since last time; I am just resending all because
I have added a few patches that I intend to backport and that therefore
should be applied before "Simplify writing to AVBPrint".

 libavcodec/movtextenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philip Langdale Oct. 19, 2020, 7:12 p.m. UTC | #1
On Sat, 17 Oct 2020 09:37:38 +0200
Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:

> Background colour was never initialized if no style was available.
> Use a sane default of zero (i.e. completely transparent).
> 
> Fixes Coverity issue #1461471.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
> No change for this patch since last time; I am just resending all
> because I have added a few patches that I intend to backport and that
> therefore should be applied before "Simplify writing to AVBPrint".
> 
>  libavcodec/movtextenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
> index 5f60b8db61..11db240ab7 100644
> --- a/libavcodec/movtextenc.c
> +++ b/libavcodec/movtextenc.c
> @@ -205,7 +205,7 @@ static int
> encode_sample_description(AVCodecContext *avctx) ASS *ass;
>      ASSStyle *style;
>      int i, j;
> -    uint32_t tsmb_size, tsmb_type, back_color, style_color;
> +    uint32_t tsmb_size, tsmb_type, back_color = 0, style_color;
>      uint16_t style_start, style_end, fontID, count;
>      int font_names_total_len = 0;
>      MovTextContext *s = avctx->priv_data;

This movtextenc series looks good. Sorry I missed it earlier.

Thanks!


--phil
diff mbox series

Patch

diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index 5f60b8db61..11db240ab7 100644
--- a/libavcodec/movtextenc.c
+++ b/libavcodec/movtextenc.c
@@ -205,7 +205,7 @@  static int encode_sample_description(AVCodecContext *avctx)
     ASS *ass;
     ASSStyle *style;
     int i, j;
-    uint32_t tsmb_size, tsmb_type, back_color, style_color;
+    uint32_t tsmb_size, tsmb_type, back_color = 0, style_color;
     uint16_t style_start, style_end, fontID, count;
     int font_names_total_len = 0;
     MovTextContext *s = avctx->priv_data;