Skip to content

Commit

Permalink
error on out-of-range cpb_cnt_minus1 (oss-fuzz issue 27590)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Apr 5, 2022
1 parent 900772c commit 8e89fe0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libde265/sps.cc
Expand Up @@ -435,7 +435,10 @@ de265_error seq_parameter_set::read(error_queue* errqueue, bitreader* br)

vui_parameters_present_flag = get_bits(br,1);
if (vui_parameters_present_flag) {
vui.read(errqueue, br, this);
de265_error err = vui.read(errqueue, br, this);
if (err) {
return err;
}
}


Expand Down
6 changes: 6 additions & 0 deletions libde265/vui.cc
Expand Up @@ -201,6 +201,9 @@ de265_error video_usability_information::hrd_parameters(error_queue* errqueue, b
if (!low_delay_hrd_flag[i])
{
READ_VLC_OFFSET(cpb_cnt_minus1[i], uvlc, 0);
if (cpb_cnt_minus1[i] > 31) {
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
}

for (nalOrVcl = 0; nalOrVcl < 2; nalOrVcl++)
Expand Down Expand Up @@ -361,6 +364,9 @@ de265_error video_usability_information::read(error_queue* errqueue, bitreader*
if (vui_hrd_parameters_present_flag) {
de265_error err;
err = hrd_parameters(errqueue, br, sps);
if (err) {
return err;
}
}
}

Expand Down

0 comments on commit 8e89fe0

Please sign in to comment.