Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvcdec: Integer overflow in imvcd_parse_subset_sps #74

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions decoder/mvc/imvcd_nalu_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,17 @@ static WORD32 imvcd_parse_subset_sps(mvc_dec_ctxt_t *ps_mvcd_ctxt, dec_bit_strea

if(ps_subset_sps->s_sps_data.u1_pic_order_cnt_type == 0)
{
ps_subset_sps->s_sps_data.u1_log2_max_pic_order_cnt_lsb_minus =
4 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
UWORD32 u1_log2_max_pic_order_cnt_lsb_minus4 =
ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);

if(ps_subset_sps->s_sps_data.u1_log2_max_pic_order_cnt_lsb_minus > MAX_BITS_IN_POC_LSB)
if(u1_log2_max_pic_order_cnt_lsb_minus4 > (MAX_BITS_IN_POC_LSB - 4))
{
return ERROR_INV_SPS_PPS_T;
}

ps_subset_sps->s_sps_data.u1_log2_max_pic_order_cnt_lsb_minus =
4 + u1_log2_max_pic_order_cnt_lsb_minus4;

ps_subset_sps->s_sps_data.i4_max_pic_order_cntLsb =
(1 << ps_subset_sps->s_sps_data.u1_log2_max_pic_order_cnt_lsb_minus);
}
Expand Down