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@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt
2020-10-15 14:12:21 +02:00
parent 5da94413d1
commit 56b3726ed2

View 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;