[FFmpeg-devel] [PATCH 08/11] avcodec/evc_parse: free pps struct on parsing failure
James Almer
jamrial at gmail.com
Thu Jun 15 18:18:32 EEST 2023
Prevents future checks for their presence from succeeding.
Signed-off-by: James Almer <jamrial at gmail.com>
---
libavcodec/evc_parse.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/evc_parse.c b/libavcodec/evc_parse.c
index 3e315526fa..4b9d820d34 100644
--- a/libavcodec/evc_parse.c
+++ b/libavcodec/evc_parse.c
@@ -367,8 +367,10 @@ EVCParserPPS *ff_evc_parse_pps(EVCParserContext *ctx, const uint8_t *bs, int bs_
pps->pps_pic_parameter_set_id = pps_pic_parameter_set_id;
pps->pps_seq_parameter_set_id = get_ue_golomb(&gb);
- if (pps->pps_seq_parameter_set_id >= EVC_MAX_SPS_COUNT)
+ if (pps->pps_seq_parameter_set_id >= EVC_MAX_SPS_COUNT) {
+ av_freep(&ctx->pps[pps_pic_parameter_set_id]);
return NULL;
+ }
pps->num_ref_idx_default_active_minus1[0] = get_ue_golomb(&gb);
pps->num_ref_idx_default_active_minus1[1] = get_ue_golomb(&gb);
--
2.41.0
More information about the ffmpeg-devel
mailing list