Skip to content

Commit cf6771c

Browse files
committed
fixed #1898
1 parent 30ac5e5 commit cf6771c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: src/media_tools/av_parsers.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -4705,8 +4705,12 @@ u32 gf_bs_read_ue_log_idx3(GF_BitStream *bs, const char *fname, s32 idx1, s32 id
47054705
}
47064706

47074707
if (nb_lead) {
4708+
u32 leads=1;
47084709
val = gf_bs_read_int(bs, nb_lead);
4709-
val += (1 << nb_lead) - 1;
4710+
leads <<= nb_lead;
4711+
leads -= 1;
4712+
val += leads;
4713+
// val += (1 << nb_lead) - 1;
47104714
bits += nb_lead;
47114715
}
47124716

@@ -5671,7 +5675,7 @@ static s32 avc_parse_slice(GF_BitStream *bs, AVCState *avc, Bool svc_idr_flag, A
56715675
if (si->slice_type > 9) return -1;
56725676

56735677
pps_id = gf_bs_read_ue_log(bs, "pps_id");
5674-
if (pps_id > 255) return -1;
5678+
if ((pps_id<0) || (pps_id > 255)) return -1;
56755679
si->pps = &avc->pps[pps_id];
56765680
if (!si->pps->slice_group_count) return -2;
56775681
si->sps = &avc->sps[si->pps->sps_id];

0 commit comments

Comments
 (0)