[FFmpeg-devel] [PATCH 1/2] avcodec/movtextenc: Fix potential use of unitialized value

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Thu Oct 15 17:00:50 EEST 2020


Background colour was never initialized if no style was available.
Use a sane default of zero (i.e. completely transparent).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavcodec/movtextenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index b2368b641b..00ebca2e56 100644
--- a/libavcodec/movtextenc.c
+++ b/libavcodec/movtextenc.c
@@ -202,7 +202,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;
-- 
2.25.1



More information about the ffmpeg-devel mailing list