aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-15 14:12:21 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:58 +0100
commitbb8d18a39bee5dba0137c22f1f1fcec2254c4bc7 (patch)
tree24685936028865bba1057af63376beb90ea4de9a
parent1eb8f6885eb858a444164bbf97db3ff5401e6a86 (diff)
downloadffmpeg-bb8d18a39bee5dba0137c22f1f1fcec2254c4bc7.tar.gz
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> (cherry picked from commit 56b3726ed2ac89df31a939a8f5f00fa66a0ad2ed)
-rw-r--r--libavcodec/movtextenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index f38cd9cba2..56781af1f8 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;