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>
pull/355/head
Andreas Rheinhardt 4 years ago
parent 5da94413d1
commit 56b3726ed2
  1. 2
      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;

Loading…
Cancel
Save