From 57879b23bc77013ac6832d19b62203975718f557 Mon Sep 17 00:00:00 2001 From: James Almer Date: Thu, 15 Jun 2023 10:33:25 -0300 Subject: [PATCH] avcodec/evc_parse: zero sps, pps and sh structs Otherwise stale values may remain in place. Signed-off-by: James Almer --- libavcodec/evc_parse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/evc_parse.c b/libavcodec/evc_parse.c index c8d3c921c8..6ecfbccfde 100644 --- a/libavcodec/evc_parse.c +++ b/libavcodec/evc_parse.c @@ -200,6 +200,8 @@ EVCParserSPS *ff_evc_parse_sps(EVCParserContext *ctx, const uint8_t *bs, int bs_ } sps = ctx->sps[sps_seq_parameter_set_id]; + memset(sps, 0, sizeof(*sps)); + sps->sps_seq_parameter_set_id = sps_seq_parameter_set_id; // the Baseline profile is indicated by profile_idc eqal to 0 @@ -360,6 +362,7 @@ EVCParserPPS *ff_evc_parse_pps(EVCParserContext *ctx, const uint8_t *bs, int bs_ } pps = ctx->pps[pps_pic_parameter_set_id]; + memset(pps, 0, sizeof(*pps)); pps->pps_pic_parameter_set_id = pps_pic_parameter_set_id; @@ -440,6 +443,7 @@ EVCParserSliceHeader *ff_evc_parse_slice_header(EVCParserContext *ctx, const uin } sh = ctx->slice_header[slice_pic_parameter_set_id]; + memset(sh, 0, sizeof(*sh)); pps = ctx->pps[slice_pic_parameter_set_id]; if(!pps)