Commit graph

597 commits

Author SHA1 Message Date
Xin Li
f59c3864fe Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I829eb4215ea9aa15adf66e8bbdb37ec88a9bb6a4
Change-Id: I2e739d3606ba9f0938ebc2363cb9443ec3dec912
2020-11-23 13:14:11 -08:00
Shivaansh Agrawal
6efeedf063 Decoder: Fix integer overflow in parse slice
Bug: 165976727
Test: POC in bug description
Change-Id: Ia2c8ad5fe6e212d3910a9c91cda52c19f3fac120
2020-11-17 23:34:54 +05:30
Ray Essick
e76f029dc4 Merge "Decoder: Fix integer overflow when scaling motion vectors" 2020-10-11 05:09:38 +00:00
Treehugger Robot
f7225b7fa5 Merge "Decoder: Fix unsigned integer overflow" 2020-10-09 20:06:04 +00:00
Hamsalekha S
3fe5adf3ad Decoder: Fix heap buffer overflow. am: 0b601e1a4f
Original change: 12266630

Change-Id: I829eb4215ea9aa15adf66e8bbdb37ec88a9bb6a4
2020-09-27 17:43:42 +00:00
Neelkamal Semwal
fcf0c2774c Decoder: Fix integer overflow when scaling motion vectors
Typecast to 64-bits for valid overflowing arithmetic operations

Bug: 143791664
Bug: 150044751

Test: poc in bug description

Change-Id: I1b938c7c2d4d817979fff65ab271a42f6bdc3e89
2020-09-18 22:59:16 +05:30
Shivaansh Agrawal
2a28c97cd6 Decoder: Fix NPD issue in mmco function
Skip mmco buffer operations if mmco error in sequence

Bug: 168426116
Bug: 168426117
Test: POC in bug description
Change-Id: Ia4f3f48137152e211322ed97f2fafab2f45cb2c3
2020-09-16 17:07:13 +05:30
Manisha Jajoo
8217d22de9 Decoder: Fix unsigned integer overflow
Fix integer overflow issues in parse functions

Test: poc in bug

Bug: 143791646
Bug: 150045816

Change-Id: Ie0bde7a5cf266fe327b1d5e43fffe28f6e402188
2020-08-28 15:02:17 +05:30
Xin Li
70bf1e5994 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I49c82ad516931b8a7c90dc446a5df5e6ee52e56f
Change-Id: I609894770235673dc005d118062b9f8b4af08ba8
2020-08-27 10:16:27 -07:00
Treehugger Robot
2baef25896 Merge "Decoder: Integer overflow fixes in parsing Qp and weights" 2020-08-20 15:24:02 +00:00
Ray Essick
adfbdd6c41 Merge "decoder: Update reorder depth to account for display latency" 2020-08-17 05:21:00 +00:00
Harish Mahendrakar
f792904577 decoder: Update reorder depth to account for display latency
Decoder returns output with an additional latency of 2.
reorder depth retured is now updated to account for this extra latency

Also move reorder_depth initialization to parse_sps()
Instead of initializing reorder_depth after decoding first picture,
initialize it in parse_sps().

Bug: 163127030
Test: poc in bug
Test: atest android.mediav2.cts

Change-Id: I94b35b2c5df5c910d0159548b168617946a19cc2
2020-08-13 19:23:26 -07:00
Harish Mahendrakar
08b77b2351 Decoder: Integer overflow fixes in parsing Qp and weights
Error checks for syntax elements related to QP,
luma and chroma prediction weights have been modified
to fix overflow

Bug: 136568141
Bug: 143801227
Bug: 143791288

Test: POC in bug description

Change-Id: I88e886ba4bcda69079f1b0a8344005fe1aa51366
2020-08-06 23:10:15 -07:00
Ray Essick
159799b4d4 Merge "Decoder: Fix integer overflow in poc calculation" 2020-08-04 20:57:51 +00:00
Shivaansh Agrawal
dfd1f2ff70 Decoder: Fix integer overflow in poc calculation
Passed error and standard compliance tests with integer and address sanitizers.

Bug: 143791063
Test: POC in bug description
Change-Id: Idbba64cfb397b8af3ccd5770ce115fadd0d9112c
2020-08-04 12:16:57 +05:30
Hamsalekha S
0b601e1a4f Decoder: Fix heap buffer overflow.
Fix bitstream buffer overflow in the function
ih264d_parse_sei_message

Bug: 152895390

Test: POC in bug

Change-Id: I41ff1f7b2834c2d09e546b8e3d37e4cd4abfa28d
2020-07-29 23:47:11 +00:00
Ray Essick
2c7af2702b Merge "decoder: fix integer overflow when setting i4_prev_max_display_seq" 2020-07-29 21:29:42 +00:00
Shivaansh Agrawal
358b09305a decoder: fix integer overflow when setting i4_prev_max_display_seq
reset ps_dec->i4_prev_max_display_seq if out of int32 range
to avoid overflow

Bug: 143791121
Bug: 143791161
Test: POC in bug description
Change-Id: I3d8df556b003a7c739716bb33262ab3a6ca7b2d9
2020-07-29 04:39:31 +00:00
Harish Mahendrakar
487d9e6e24 decoder: Allow stride to be smaller than decode width am: a0036e742b am: e4649d8d3f
Original change: 1358387

Change-Id: I49c82ad516931b8a7c90dc446a5df5e6ee52e56f
2020-07-09 23:29:53 +00:00
Harish Mahendrakar
a0036e742b decoder: Allow stride to be smaller than decode width
When cropping is enabled, application can request a stride that
is larger than display width but smaller than decode width.

Bug: 160397536
Test: stagefright -sS <clip in bug>

Change-Id: I453b2de0474f3ae4d021084729c33d52fc1090dc
2020-07-09 17:59:47 +00:00
Aasaipriya Chandran
623f5587d7 Decoder: Fix Null dereference am: 083b9fc086 am: 5365d9ad7f
Original change: 1328476

Change-Id: I1e8275497a20105f4c1545ac4022569005191367
2020-07-01 05:20:11 +00:00
Aasaipriya Chandran
083b9fc086 Decoder: Fix Null dereference
Add checks to validate long term index and
max long term index parsed in MMCO commands.

Bug: 140358770
Bug: 140680655
Bug: 148772548
Bug: 152148135
Bug: 152434373
Bug: 152550528

Test: poc in bug
Change-Id: I9052ce7721491fdd5fb4807ec33e399cee8c70cf
2020-06-12 17:21:26 +05:30
Harish Mahendrakar
e0ad0016f0 Revert "decoder: set u4_frame_decoded to true only after both fields are decoded"
This reverts commit f76370c671.

Reason: This breaks interlaced clips which are sent one field at a time

C2 plugin for avc decoder is now updated to appropriately handle both
types of interlaced content, i.e. sent as one field per one input buffer
and sent as two fields per one input

Bug: 135146280
Bug: 152087140
Test: poc in bugs
Test: atest android.media.cts.DecoderTest

Change-Id: Ic79d13a4bd93573767c86ed31264e8780da8d9a5
2020-04-06 15:33:53 -07:00
TreeHugger Robot
66556bc9a3 Merge "decoder: Fix lt_ref increment in ih264d_fix_error_in_dpb" into qt-qpr1-dev am: 280902e61f
Change-Id: I3a0e050d5e7f17f8233dd7203d0a382c86a70971
2020-03-20 02:39:03 +00:00
Harish Mahendrakar
c0215b1b3d decoder: Fix in detecting dangling fields am: 6dd54b9e18
Change-Id: I61076f4526feeb891a5f866d6f965211e9e65edc
2020-03-20 02:38:56 +00:00
TreeHugger Robot
7286f5f021 Merge "decoder: Fix lt_ref increment in ih264d_fix_error_in_dpb" into qt-qpr1-dev am: 280902e61f
Change-Id: I3f9e5f1019b7759e83a2cc7f2848766f52bcdfed
2020-03-20 02:38:53 +00:00
Harish Mahendrakar
7e44189621 decoder: Fix in detecting dangling fields am: 6dd54b9e18
Change-Id: Ia546016131ba894365e90089a6644383c76bf325
2020-03-20 02:38:43 +00:00
TreeHugger Robot
280902e61f Merge "decoder: Fix lt_ref increment in ih264d_fix_error_in_dpb" into qt-qpr1-dev 2020-03-20 02:24:36 +00:00
Harish Mahendrakar
f80afe5b98 decoder: Fix lt_ref increment in ih264d_fix_error_in_dpb
When removing common nodes from short term list if it present in long
term reference list, number of long term buffers was wrongly
incremented. Only decrement of short term buffer count is needed in
such a case.

Bug: 140561484
Bug: 140566606
Bug: 140699853
Bug: 144980954
Bug: 145859214

Test: poc in bug
Change-Id: Iebf7ee7ed65e7b2097a899577982806b03fc6e5d
2020-02-11 16:29:24 -08:00
Harish Mahendrakar
6dd54b9e18 decoder: Fix in detecting dangling fields
When decoder is expecting to decode a field, ensure current slice
being decoded is a field and frame number matches with previous slice's
frame number.

Bug: 144687080
Test: poc in bug
Change-Id: I89d9d7b6fc26797de0420ecb0ca7e66b066aa908
2020-02-11 16:03:29 -08:00
Automerger Merge Worker
2f6f64e1c1 Merge "decoder: Fix minimum poc calculation check while adding to display" into oc-dev am: 9d7a036d7b am: cebf26ab4d am: f64194a96f am: ed2b83d989 am: 4b7a562681 am: 8c2ee3ea8b am: 826a705863
Change-Id: Ife6f6d0a5231076a9fec4cbf9a449f1fd67abc08
2020-01-09 05:21:04 +00:00
Automerger Merge Worker
826a705863 Merge "decoder: Fix minimum poc calculation check while adding to display" into oc-dev am: 9d7a036d7b am: cebf26ab4d am: f64194a96f am: ed2b83d989 am: 4b7a562681 am: 8c2ee3ea8b
Change-Id: Idf10b1ae11ad8f376d0b3f2587bebeeece6126f1
2020-01-09 05:04:07 +00:00
Automerger Merge Worker
8c2ee3ea8b Merge "decoder: Fix minimum poc calculation check while adding to display" into oc-dev am: 9d7a036d7b am: cebf26ab4d am: f64194a96f am: ed2b83d989 am: 4b7a562681
Change-Id: I0966eed6f66382e3fa7ccc19558734cc202ed0f3
2020-01-09 04:51:33 +00:00
Automerger Merge Worker
4b7a562681 Merge "decoder: Fix minimum poc calculation check while adding to display" into oc-dev am: 9d7a036d7b am: cebf26ab4d am: f64194a96f am: ed2b83d989
Change-Id: I7feff45df303f49d95b4d5b07019929dead2810c
2020-01-09 04:38:27 +00:00
Automerger Merge Worker
f64194a96f Merge "decoder: Fix minimum poc calculation check while adding to display" into oc-dev am: 9d7a036d7b am: cebf26ab4d
Change-Id: Ib8872212d43d41ae25f28992b6c02ab15cb72b26
2020-01-09 04:06:39 +00:00
TreeHugger Robot
9d7a036d7b Merge "decoder: Fix minimum poc calculation check while adding to display" into oc-dev 2020-01-09 03:32:14 +00:00
Harish Mahendrakar
ffcf2a87d6 decoder: Fix minimum poc calculation check while adding to display
While adding the decoded buffer to display queue, allow buffer with
poc set to 0x7FFFFFFF

Bug: 145364230
Test: poc in bug
Change-Id: I2a15f73b8422cfa4fd3360bc21c0cea4542a3375
2020-01-02 10:22:38 -08:00
Harish Mahendrakar
e40cbbfc51 decoder: Move initialization of dbp_mgr entries to init_decoder() am: 01da7b5a52 am: 41fcd228ae am: cce42ea920 am: 6c9873af88 am: 662efee177 am: 873bac42ec am: 474797af3c
am: 942e7f8896

Change-Id: I3fb8acb951bc8043546ab1c8956b664427b16295
2019-11-05 17:20:44 -08:00
Harish Mahendrakar
942e7f8896 decoder: Move initialization of dbp_mgr entries to init_decoder() am: 01da7b5a52 am: 41fcd228ae am: cce42ea920 am: 6c9873af88 am: 662efee177 am: 873bac42ec
am: 474797af3c

Change-Id: I315a135615fdace5bc573e9f585133a991b30c77
2019-11-05 17:11:11 -08:00
Harish Mahendrakar
474797af3c decoder: Move initialization of dbp_mgr entries to init_decoder() am: 01da7b5a52 am: 41fcd228ae am: cce42ea920 am: 6c9873af88 am: 662efee177
am: 873bac42ec

Change-Id: I6f5d7d5486926100a815ffcddd134cf998d35c79
2019-11-05 17:05:10 -08:00
Harish Mahendrakar
662efee177 decoder: Move initialization of dbp_mgr entries to init_decoder() am: 01da7b5a52 am: 41fcd228ae am: cce42ea920
am: 6c9873af88

Change-Id: Ie95d6b810f751847eed7bc2c17c120a891b88fef
2019-11-05 16:52:06 -08:00
Harish Mahendrakar
cce42ea920 decoder: Move initialization of dbp_mgr entries to init_decoder() am: 01da7b5a52
am: 41fcd228ae

Change-Id: Id8fa44c3401f7ac1d2a540fa35cf0f4346da2c42
2019-11-05 16:31:59 -08:00
Chamarthi Kishore
68dce05ea6 Merge changes I015ebe03,Idc0b0db5 am: 00fa4b6490 am: 7684b467b4
am: d49fffd5f4

Change-Id: I0da6b5b695adb949b28ca9d29f806cd11625d2eb
2019-10-31 19:11:43 -07:00
Chamarthi Kishore
7684b467b4 Merge changes I015ebe03,Idc0b0db5
am: 00fa4b6490

Change-Id: I71e761af5fd1551643418dd7979491c2a6b7a7ee
2019-10-31 18:59:50 -07:00
Harish Mahendrakar
01da7b5a52 decoder: Move initialization of dbp_mgr entries to init_decoder()
Earlier these were only initialized during static buffer allocations.
Initializing them in init_decoder() will ensure that these get
initialized to default values during reset() as well. Without this,
in some error cases, there is a possibility of heap-use-after free,
when resolution changes and these pointers point to memory that is freed

Bug: 142602711
Test: poc in bug
Change-Id: Ie39fee0eca56bf32cdc558099bf167d05eb89620
2019-10-29 19:52:49 -07:00
Chamarthi Kishore
ad2eaf8c7d libavc: Add MDCV, CLL, CCV and AVE SEI messages
This commit add support for encoding and decoding of MDCV, CLL, CCV and
AVE SEI messages

Test: avcenc -c enc.cfg, avcdec -c dec.cfg
Bug: 141931623

Change-Id: Idc0b0db5291482ae2bc19cdff65669c32374b02a
2019-10-24 17:20:00 +05:30
Harish Mahendrakar
41ea72e48f Fix integer overflows in computing poc and pic numbers am: 1d672d2bea am: f2157c2dc1 am: 684b6687dc
am: 59b642608e

Change-Id: I94747dc0574d94ebbde3b071efb267eeb53799c3
2019-09-30 16:50:38 -07:00
Harish Mahendrakar
59b642608e Fix integer overflows in computing poc and pic numbers am: 1d672d2bea am: f2157c2dc1
am: 684b6687dc

Change-Id: Iec8807289080cb3c9c6081ba1ff59001983773ba
2019-09-30 16:43:37 -07:00
Harish Mahendrakar
1d672d2bea Fix integer overflows in computing poc and pic numbers
Test: poc in bug
Bug: 135303936
Bug: 136568141

Change-Id: Ie426c678b60f2d078d0b39e73a44d42d931d7fe3
2019-09-30 18:25:07 +00:00
Harish Mahendrakar
da990db40a Merge "Fix integer overflows while intializing reference lists" am: 47d5e6bb93 am: f374a3c5d1 am: 31d4186111
am: d6ed5b9a0c

Change-Id: I52d3e462e9cb180f943d003a12401d70e448dd42
2019-09-28 10:47:06 -07:00