Merge "Decoder: Fix integer overflow in poc calculation"

This commit is contained in:
Ray Essick 2020-08-04 20:57:51 +00:00 committed by Gerrit Code Review
commit 159799b4d4

View file

@ -1494,7 +1494,11 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec,
ps_dec->p_motion_compensate = ih264d_motion_compensate_bp;
if(ps_dec->ps_cur_pic != NULL)
poc = ps_dec->ps_cur_pic->i4_poc + 2;
{
poc = ps_dec->ps_cur_pic->i4_poc;
if (poc <= INT32_MAX - 2)
poc += 2;
}
j = -1;
for(i = 0; i < MAX_NUM_PIC_PARAMS; i++)