1
0
Fork 0

avcodec/evc_ps: Fix leak on error

Regression since 4565747056.
Fixes Coverity ticket #1545072.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-09-21 19:17:54 +02:00
parent e1530a319a
commit 378f1b6a39
1 changed files with 4 additions and 2 deletions

View File

@ -255,8 +255,10 @@ int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps)
sps->max_num_tid0_ref_pics = get_ue_golomb_31(gb);
else {
sps->sps_max_dec_pic_buffering_minus1 = get_ue_golomb_long(gb);
if ((unsigned)sps->sps_max_dec_pic_buffering_minus1 > 16 - 1)
return AVERROR_INVALIDDATA;
if ((unsigned)sps->sps_max_dec_pic_buffering_minus1 > 16 - 1) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
sps->long_term_ref_pic_flag = get_bits1(gb);
sps->rpl1_same_as_rpl0_flag = get_bits1(gb);
sps->num_ref_pic_list_in_sps[0] = get_ue_golomb(gb);