[FFmpeg-cvslog] avcodec/movtextenc: Fix potential use of uninitialized value

Andreas Rheinhardt git at videolan.org
Mon Oct 19 23:05:11 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Thu Oct 15 14:12:21 2020 +0200| [56b3726ed2ac89df31a939a8f5f00fa66a0ad2ed] | committer: Andreas Rheinhardt

avcodec/movtextenc: Fix potential use of uninitialized value

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 at overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=56b3726ed2ac89df31a939a8f5f00fa66a0ad2ed
---

 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;



More information about the ffmpeg-cvslog mailing list