summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2016-09-17 14:04:29 +0530
committergitbuildkicker <android-build@google.com>2016-09-27 15:55:53 -0700
commit3d1492200e76765a239bdb721e7621b6a774b9d0 (patch)
treee6eb46e41bae0d0fe49e340692f6e0282d76d6d7
parent7109ce3f8f90a28ca9f0ee6e14f6ac5e414c62cf (diff)
downloadandroid_external_libavc-3d1492200e76765a239bdb721e7621b6a774b9d0.tar.gz
android_external_libavc-3d1492200e76765a239bdb721e7621b6a774b9d0.tar.bz2
android_external_libavc-3d1492200e76765a239bdb721e7621b6a774b9d0.zip
Fix in the case of invalid SPS PPS
Bug: 31092462 Change-Id: I0e2ab5a1088717bbf36f6b0cf859b5a6e0f59c5d (cherry picked from commit c2e8ffe451e2a78161037ca09a3516e65c80675c)
-rw-r--r--decoder/ih264d_api.c5
-rw-r--r--decoder/ih264d_parse_pslice.c19
2 files changed, 20 insertions, 4 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index 6aa71f2..cbfc8ca 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -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;
}
}
diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c
index ca5c393..8f9949f 100644
--- a/decoder/ih264d_parse_pslice.c
+++ b/decoder/ih264d_parse_pslice.c
@@ -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;