diff options
Diffstat (limited to 'decoder/ih264d_parse_pslice.c')
-rw-r--r-- | decoder/ih264d_parse_pslice.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c index c712ed5..dfd1ba8 100644 --- a/decoder/ih264d_parse_pslice.c +++ b/decoder/ih264d_parse_pslice.c @@ -1489,10 +1489,27 @@ 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; + } + + /* call ih264d_start_of_pic only if it was not called earlier*/ + if(ps_dec->u4_pic_buf_got == 0) { //initialize slice params required by ih264d_start_of_pic to valid values ps_dec->ps_cur_slice->u1_slice_type = P_SLICE; @@ -1563,7 +1580,8 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec, && ps_parse_cur_slice == ps_dec->ps_parse_cur_slice) { // Slice data corrupted - u1_num_mbs = ps_dec->u4_num_mbs_cur_nmb; + // in the case of mbaff, conceal from the even mb. + u1_num_mbs = (ps_dec->u4_num_mbs_cur_nmb >> u1_mbaff ) << u1_mbaff; if(u1_num_mbs) { |