commit | d7617ea8b9615ed38157d9b1a3dbb2f99cd6183b | [log] [tgz] |
---|---|---|
author | Ray Essick <essick@google.com> | Tue Aug 04 21:12:22 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Aug 04 21:12:22 2020 +0000 |
tree | ddd396bfc3df7014ee8994d8ad1420f31abe4b79 | |
parent | 8bca87a027d34962d0fb2283d6d408ee09b00472 [diff] | |
parent | 159799b4d41db730704416ac99614906823f7ff8 [diff] |
Merge "Decoder: Fix integer overflow in poc calculation" am: 159799b4d4 Original change: https://android-review.googlesource.com/c/platform/external/libavc/+/1376336 Change-Id: Ic170fcb5a850f2fbf09043b81b92a0b31380b7c3
diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c index 9b9256b..43979dc 100644 --- a/decoder/ih264d_parse_pslice.c +++ b/decoder/ih264d_parse_pslice.c
@@ -1494,7 +1494,11 @@ 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++)