diff options
author | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | 2016-04-26 16:36:03 +0530 |
---|---|---|
committer | Sean McCreary <mccreary@mcwest.org> | 2017-04-05 19:10:39 -0600 |
commit | 868ba5cda871c27431763d639a464580d8145b9c (patch) | |
tree | 9e227b68d6097ba0c99da1e4712600c15875483a /decoder | |
parent | 9dd9ccf7d0c90640080fe35595517ef07a132123 (diff) | |
download | android_external_libavc-868ba5cda871c27431763d639a464580d8145b9c.tar.gz android_external_libavc-868ba5cda871c27431763d639a464580d8145b9c.tar.bz2 android_external_libavc-868ba5cda871c27431763d639a464580d8145b9c.zip |
Decoder: Treat first slice in a picture as part of new picture always
This is needed to decode streams with consecutive IDRs.
Bug: 34097231
Test: successful run of POC in security bug
AOSP-Change-Id: Ib737a4ef4b8c5bb7a57c90292102dd28af0615fe
CVE-2017-0551
Change-Id: I5d2569034b03ba44830d96319a354e0cb0e665d3
(cherry picked from commit 8b5fd8f24eba5dd19ab2f80ea11a9125aa882ae2)
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/ih264d_parse_slice.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c index 11a317b..8fd4519 100644 --- a/decoder/ih264d_parse_slice.c +++ b/decoder/ih264d_parse_slice.c @@ -1259,8 +1259,11 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice, /*--------------------------------------------------------------------*/ /* Check if the slice is part of new picture */ /*--------------------------------------------------------------------*/ - i1_is_end_of_poc = 0; - if(!ps_dec->u1_first_slice_in_stream) + /* First slice of a picture is always considered as part of new picture */ + i1_is_end_of_poc = 1; + ps_dec->ps_dec_err_status->u1_err_flag &= MASK_REJECT_CUR_PIC; + + if(ps_dec->u4_first_slice_in_pic != 2) { i1_is_end_of_poc = ih264d_is_end_of_pic(u2_frame_num, u1_nal_ref_idc, &s_tmp_poc, &ps_dec->s_cur_pic_poc, @@ -1268,23 +1271,6 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice, u1_nal_unit_type, u4_idr_pic_id, u1_field_pic_flag, u1_bottom_field_flag); - - /* since we support only Full frame decode, every new process should - * process a new pic - */ - if((ps_dec->u4_first_slice_in_pic == 2) && (i1_is_end_of_poc == 0)) - { - /* if it is the first slice is process call ,it should be a new frame. If it is not - * reject current pic and dont add it to dpb - */ - ps_dec->ps_dec_err_status->u1_err_flag |= REJECT_CUR_PIC; - i1_is_end_of_poc = 1; - } - else - { - /* reset REJECT_CUR_PIC */ - ps_dec->ps_dec_err_status->u1_err_flag &= MASK_REJECT_CUR_PIC; - } } /*--------------------------------------------------------------------*/ |