Fix in the case of invalid SPS PPS

am: c2e8ffe451

Change-Id: Iaf266c5ff2187ba980737b699884e3ebebe87bd0
This commit is contained in:
Harish Mahendrakar 2016-09-21 20:38:58 +00:00 committed by android-build-merger
commit ff7ccdab0c
2 changed files with 20 additions and 4 deletions

View file

@ -2146,9 +2146,10 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
ret1 = ih264d_mark_err_slice_skip(ps_dec, num_mb_skipped, ps_dec->u1_nal_unit_type == IDR_SLICE_NAL, ps_dec->ps_cur_slice->u2_frame_num,
&temp_poc, prev_slice_err);
if((ret1 == ERROR_UNAVAIL_PICBUF_T) || (ret1 == ERROR_UNAVAIL_MVBUF_T))
if((ret1 == ERROR_UNAVAIL_PICBUF_T) || (ret1 == ERROR_UNAVAIL_MVBUF_T) ||
(ret1 == ERROR_INV_SPS_PPS_T))
{
return IV_FAIL;
ret = ret1;
}
}

View file

@ -1489,10 +1489,25 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec,
if(ps_dec->ps_cur_pic != NULL)
poc = ps_dec->ps_cur_pic->i4_poc + 2;
j = 0;
j = -1;
for(i = 0; i < MAX_NUM_PIC_PARAMS; i++)
{
if(ps_dec->ps_pps[i].u1_is_valid == TRUE)
j = i;
{
if(ps_dec->ps_pps[i].ps_sps->u1_is_valid == TRUE)
{
j = i;
break;
}
}
}
//if valid SPS PPS is not found return error
if(j == -1)
{
return ERROR_INV_SPS_PPS_T;
}
{
//initialize slice params required by ih264d_start_of_pic to valid values
ps_dec->ps_cur_slice->u1_slice_type = P_SLICE;