]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/movtextenc: Fix potential use of uninitialized value
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 15 Oct 2020 12:12:21 +0000 (14:12 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 19 Oct 2020 19:36:17 +0000 (21:36 +0200)
Background colour was never initialized if no style was available.
Use a sane default of zero (i.e. completely transparent).

Fixes Coverity issue #1461471.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/movtextenc.c

index 5f60b8db610027d720d6a82e58556aacce91548f..11db240ab7c2164464b807095152c19faf1498f0 100644 (file)
@@ -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;