OSDN Git Service

android-x86/frameworks-av.git
4 years agoMerge tag 'android-8.1.0_r69' into oreo-x86 android-x86-8.1-r3 android-x86-8.1-r4
Chih-Wei Huang [Thu, 24 Oct 2019 04:07:30 +0000 (12:07 +0800)]
Merge tag 'android-8.1.0_r69' into oreo-x86

Android 8.1.0 Release 69 (5794017)

4 years agoFix OOB access in mpeg4/h263 decoder
Marco Nelissen [Tue, 23 Jul 2019 15:27:46 +0000 (08:27 -0700)]
Fix OOB access in mpeg4/h263 decoder

The decoder does not support an increase in frame width, and
would exceed its buffer if the width increased mid-stream.
There was an existing check to prevent the total frame size
(width*height) from increasing, but in fact the decoder also
does not even support a width increase, even if the height
decreases correspondingly.

Bug: 136175447
Bug: 136173699
Test: manual
Change-Id: Ic2d28bb0503635dadeb69ba3be9412d58684e910
(cherry picked from commit ef4ce157000b2b5bcbf2bcb36a228ec604803547)

4 years agom4v_h263: add a test for invalid/negative value
Dongwon Kang [Fri, 21 Jun 2019 21:17:58 +0000 (14:17 -0700)]
m4v_h263: add a test for invalid/negative value

Test: run poc with and without the patch.
Bug: 134578122
Change-Id: I2d11826d1d9e2669aa5627065dc627729ddc823b
(cherry picked from commit 7802c68aebf7908983508fd4a52a7d53746a80eb)

4 years agoAMR WB encoder: prevent OOB write in ACELP_4t64_fx
Jean-Michel Trivi [Fri, 17 May 2019 14:29:07 +0000 (07:29 -0700)]
AMR WB encoder: prevent OOB write in ACELP_4t64_fx

In ACELP_4t64_fx, when iterating over ind array, check index against
  array size to prevent OOB write, log an error if such an access
  was about to happen.

Bug: 132647222
Test: atest EncoderTest#testAMRWBEncoders
Change-Id: I33f476d94baec2feffc7bcccd0ad0481b8452518
(cherry picked from commit 82cb46d0d55a407f468023977204eb7133b7fd77)
Merged-in: I33f476d94baec2feffc7bcccd0ad0481b8452518
(cherry picked from commit 9a44849c88b306e1b4fb37bd9aa34d6ba0607b7a)

4 years agohttplive: detect oom if playlist is infinite
Robert Shih [Fri, 31 May 2019 02:07:47 +0000 (19:07 -0700)]
httplive: detect oom if playlist is infinite

Bug: 68399439
Test: StagefrightTest#testStagefright_cve_2017_13279
Change-Id: Icf39c2ae58d9d6ba7c74bbcfbe2154e66e6c9e40
(cherry picked from commit f3808d3a2e8c646d5edad451a80daa61a4e5d836)

4 years agoFix overflow/dos in 3gg text description parsing
Marco Nelissen [Tue, 14 May 2019 17:53:06 +0000 (10:53 -0700)]
Fix overflow/dos in 3gg text description parsing

Bug: 124781927
Test: run pocs
Change-Id: I8765ac9746c3de7d711ef866d4ec0e29972320c0
(cherry picked from commit 851e22d1dc89a7f708b9d2b56947f69cd1a08b94)

4 years agoDO NOT MERGE: audiopolicy: Remove raw pointer references to AudioMix
Mikhail Naganov [Wed, 6 Mar 2019 00:55:28 +0000 (16:55 -0800)]
DO NOT MERGE: audiopolicy: Remove raw pointer references to AudioMix

AudioInputDescriptor, AudioOutputDescriptor, and AudioSession used
to reference AudioMix instances using a raw pointer. This isn't
safe as AudioMix was owned by AudioPolicyMix, which is not
referenced by descriptors.

Change AudioMix* pointers in Audio{Input|Output}Descriptor and
AudioSession to wp<AudioPolicyMix> which reflects their
relationship correctly.

To ensure that code does not operate on AudioMix instances
independently from AudioPolicyMix, and to avoid introducing
a lot of getter / setter methods into AudioPolicyMix, make
the latter to inherit AudioMix. This makes sense because
AudioPolicyMix is essentially a ref-counted version of AudioMix.

Bug: 124899895
Test: build and sanity check on marlin,
      build marlin with USE_CONFIGURABLE_AUDIO_POLICY := 1
Merged-In: Ic508caedefe721ed7e7ba6ee3e9175ba9e8dc23a
Change-Id: Ic508caedefe721ed7e7ba6ee3e9175ba9e8dc23a
(cherry picked from commit 0899a9f97ba3b2835b524d5aeb11fe6d2173ec8f)

4 years agoMerge tag 'android-8.1.0_r64' into oreo-x86 android-x86-8.1-r2
Chih-Wei Huang [Mon, 20 May 2019 09:25:09 +0000 (17:25 +0800)]
Merge tag 'android-8.1.0_r64' into oreo-x86

Android 8.1.0 Release 64 (OPM8.190505.001)

4 years agoZero-initialize HIDL structs before passing
Steven Moreland [Tue, 7 May 2019 14:48:54 +0000 (07:48 -0700)]
Zero-initialize HIDL structs before passing

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 131267328
Bug: 131356202
Merged-In: Ie91b7946f8f4406fd06e9cb4ad883b3a2704f366
Change-Id: Ie91b7946f8f4406fd06e9cb4ad883b3a2704f366
(cherry picked from commit 56173f4146914217b4872502007e8aa02b3521dd)

4 years agoRemove unused AVIExtractor source
Ray Essick [Fri, 26 Apr 2019 17:35:50 +0000 (10:35 -0700)]
Remove unused AVIExtractor source

Bug: 130651570
Test: compilation
Change-Id: I36e8221879593e0560002e404215c6efcd531ab8
(cherry picked from commit 5eaa57a5de115b50bfbe1b8d6764116c9f39a10f)

5 years agoNuPlayerCCDecoder: fix memory OOB
Wei Jia [Mon, 1 Apr 2019 23:18:53 +0000 (16:18 -0700)]
NuPlayerCCDecoder: fix memory OOB

Test: cts
Bug: 129068792
Change-Id: Id78ddc983f245feda3a81da3448196340b57f5c9
(cherry picked from commit e1c7348e1c3fed25c16ae4673101f48b1ed95b7e)
(cherry picked from commit 0f7ff70737d58abda69fa6d4524b1943d6c41461)

5 years agoaudio: ensure effect chain with specific session id is unique
Weiyin Jiang [Thu, 26 Apr 2018 16:39:29 +0000 (00:39 +0800)]
audio: ensure effect chain with specific session id is unique

It's possible that tracks with the same session id running on various
playback outputs, which causes effect chain being created on the same
session twice. As a result, the same effect engine will be released
twice as the same context is reused.

Output that has effect chain with same session id is more preferable.

Test: No regression with Play Music and Effects
Bug: 123082420
Bug: 123237974
Merged-In: I690ea3cb942d1fdc96b46048e271557d48000f43
Change-Id: I690ea3cb942d1fdc96b46048e271557d48000f43
(cherry picked from commit 9aeb1770d49bab13ea5c6454c969a713641fe686)
(cherry picked from commit 5945746bcabff8d833229a6c230cbe873474087f)

5 years agoAudioFlinger: Prevent multiple effect chains with same sessionId
Andy Hung [Wed, 13 Mar 2019 02:39:03 +0000 (19:39 -0700)]
AudioFlinger: Prevent multiple effect chains with same sessionId

Allow at most one effect chain with same sessionId on mPlaybackThreads.

Test: poc, CTS effect tests
Bug: 123237974
Merged-In: Ide46cd23b0a9f4295f0dca2fea23379a76b836ee
Change-Id: Ide46cd23b0a9f4295f0dca2fea23379a76b836ee
(cherry picked from commit 1631f06feb36df5406ad00e850dcca9394f67772)
(cherry picked from commit f963b2bfdaf406b42d371322402172b4380bbba5)

5 years agoMerge cherrypicks of [6714499, 6716593, 6716594, 6716595, 6716596, 6716597, 6716977...
android-build-team Robot [Wed, 13 Mar 2019 20:14:43 +0000 (20:14 +0000)]
Merge cherrypicks of [67144996716593671659467165956716596671659767169776718226671777367169786717663] into oc-m8-release

Change-Id: Ieb4c3a0b3350852b8db4c4638b35fc2c6f6ec362

5 years agoReserve enough space for RTSP CSD
Ray Essick [Tue, 26 Feb 2019 23:47:01 +0000 (15:47 -0800)]
Reserve enough space for RTSP CSD

make parameters to GetSizeWidth() reflect values being used in
corresponding EncodeSize() invocations so we won't overflow the buffer.

Bug: 123701862
Test: y
Change-Id: I78596176e6042c95582494a8ae1b9c3160bf5955
(cherry picked from commit c025be8ce5f1b34bdf293ac367685c969bd430ba)

5 years agoReserve enough space for RTSP CSD
Ray Essick [Tue, 26 Feb 2019 23:47:01 +0000 (15:47 -0800)]
Reserve enough space for RTSP CSD

make parameters to GetSizeWidth() reflect values being used in
corresponding EncodeSize() invocations so we won't overflow the buffer.

Bug: 123701862
Test: y
Change-Id: I78596176e6042c95582494a8ae1b9c3160bf5955
(cherry picked from commit c025be8ce5f1b34bdf293ac367685c969bd430ba)

5 years agoMerge cherrypicks of [6072696, 6072074, 6072757, 6072120, 6072121, 6072122, 6072123...
android-build-team Robot [Wed, 16 Jan 2019 18:57:05 +0000 (18:57 +0000)]
Merge cherrypicks of [607269660720746072757607212060721216072122607212360725756072576607257760725786072579607219360721316072194607207660722106072759607276060726986072699607270060727016072702607270360727046072905607290660729076072761] into oc-m8-release

Change-Id: Ia2c2924ff42d1a800a482b1d492124ba45ad5368

5 years agoAudioFlinger: put effect desc lookup under mutex for createEffect
Andy Hung [Thu, 10 Jan 2019 21:27:31 +0000 (13:27 -0800)]
AudioFlinger: put effect desc lookup under mutex for createEffect

Test: native poc
Bug: 122309228
Change-Id: I48333c69f5c1b1bf1b98f57eb813ec39e074f3a7
Merged-In: I9d339a7d6d81161065e1adaf427dd2d3430436c2
(cherry picked from commit a41770b682117fdfc20236fbc45d975099f9147a)

5 years agoRESTRICT AUTOMERGE: aaudio: improve test_atomic_fifo
Phil Burk [Mon, 3 Dec 2018 18:10:21 +0000 (10:10 -0800)]
RESTRICT AUTOMERGE: aaudio: improve test_atomic_fifo

Check for the effects of setting a bogus counter.
Check for writes to memory surrounding the FIFO.
Check for negative array indices.

Bug: 120789744
Test: this is a test
Change-Id: Ia30cdef7f9d60f0a98b9af964cb3b3159df37dc9
(cherry picked from commit 31a8d44075f37f75d5912d79a43d777587b2d695)

5 years agoRESTRICT AUTOMERGE: aaudio: Fix converting negative FIFO counters to index
Phil Burk [Mon, 3 Dec 2018 22:16:46 +0000 (14:16 -0800)]
RESTRICT AUTOMERGE: aaudio: Fix converting negative FIFO counters to index

The index into the FIFO is calculated by using:

    counter % capacity

But the counter is signed and when it is negative the
modulo can have a negative result. That can cause
a negative array index and an access out of bounds.

This is not normally a problem because the counter
is 64 bits and it will not overflow until the audio
has run for a few million years. But a hacker might
be able to modify this internal counter and force
an error.

The solution involves casting to a uint64_t before doing
the modulo.

Note that there may still be a discontinuity when the
counter wraps from -1 to 0. But that will not result
in an out-of-bounds access. It may cause a noise but
an app could simply create a noise directly. So that is
not considered an exploit.

Bug: 120789744
Test: test_atomic_fifo.cpp
Change-Id: I6fe57bcb44528d29b5edb817c592e5e9a8aaf8eb
(cherry picked from commit d1fc53ca84b3d8d074fb27e192dea8204c1fb221)

5 years agoRESTRICT AUTOMERGE: aaudio: fix FIFO wrapround frame counts
Phil Burk [Sat, 21 Apr 2018 00:24:38 +0000 (17:24 -0700)]
RESTRICT AUTOMERGE: aaudio: fix FIFO wrapround frame counts

The number of frames in the second part was incorrect
when it wrapped past the end of the FIFO.

Bug: 78139448
Bug: 120789744
Test: adb shell aaudio_loopback -c2 -C2 -tm -m2 -Pl -pn
Change-Id: Ib6a22f30f0ee5321444c6d6137d9488943c34f3d
(cherry picked from commit 685607be811e6d5fffc407d71a2703de9c351969)

5 years agoAudioFlinger: put effect desc lookup under mutex for createEffect
Andy Hung [Thu, 10 Jan 2019 21:27:31 +0000 (13:27 -0800)]
AudioFlinger: put effect desc lookup under mutex for createEffect

Test: native poc
Bug: 122309228
Change-Id: I48333c69f5c1b1bf1b98f57eb813ec39e074f3a7
Merged-In: I9d339a7d6d81161065e1adaf427dd2d3430436c2
(cherry picked from commit a41770b682117fdfc20236fbc45d975099f9147a)

5 years agoRESTRICT AUTOMERGE: aaudio: improve test_atomic_fifo
Phil Burk [Mon, 3 Dec 2018 18:10:21 +0000 (10:10 -0800)]
RESTRICT AUTOMERGE: aaudio: improve test_atomic_fifo

Check for the effects of setting a bogus counter.
Check for writes to memory surrounding the FIFO.
Check for negative array indices.

Bug: 120789744
Test: this is a test
Change-Id: Ia30cdef7f9d60f0a98b9af964cb3b3159df37dc9
(cherry picked from commit 31a8d44075f37f75d5912d79a43d777587b2d695)

5 years agoRESTRICT AUTOMERGE: aaudio: Fix converting negative FIFO counters to index
Phil Burk [Mon, 3 Dec 2018 22:16:46 +0000 (14:16 -0800)]
RESTRICT AUTOMERGE: aaudio: Fix converting negative FIFO counters to index

The index into the FIFO is calculated by using:

    counter % capacity

But the counter is signed and when it is negative the
modulo can have a negative result. That can cause
a negative array index and an access out of bounds.

This is not normally a problem because the counter
is 64 bits and it will not overflow until the audio
has run for a few million years. But a hacker might
be able to modify this internal counter and force
an error.

The solution involves casting to a uint64_t before doing
the modulo.

Note that there may still be a discontinuity when the
counter wraps from -1 to 0. But that will not result
in an out-of-bounds access. It may cause a noise but
an app could simply create a noise directly. So that is
not considered an exploit.

Bug: 120789744
Test: test_atomic_fifo.cpp
Change-Id: I6fe57bcb44528d29b5edb817c592e5e9a8aaf8eb
(cherry picked from commit d1fc53ca84b3d8d074fb27e192dea8204c1fb221)

5 years agoRESTRICT AUTOMERGE: aaudio: fix FIFO wrapround frame counts
Phil Burk [Sat, 21 Apr 2018 00:24:38 +0000 (17:24 -0700)]
RESTRICT AUTOMERGE: aaudio: fix FIFO wrapround frame counts

The number of frames in the second part was incorrect
when it wrapped past the end of the FIFO.

Bug: 78139448
Bug: 120789744
Test: adb shell aaudio_loopback -c2 -C2 -tm -m2 -Pl -pn
Change-Id: Ib6a22f30f0ee5321444c6d6137d9488943c34f3d
(cherry picked from commit 685607be811e6d5fffc407d71a2703de9c351969)

5 years agoMerge tag 'android-8.1.0_r53' into oreo-x86 android-x86-8.1-r1
Chih-Wei Huang [Fri, 21 Dec 2018 08:58:56 +0000 (16:58 +0800)]
Merge tag 'android-8.1.0_r53' into oreo-x86

Android 8.1.0 release 53

5 years agoMerge cherrypicks of [5313290, 5313323, 5313343, 5313415, 5313291, 5313441, 5313557...
android-build-team Robot [Fri, 19 Oct 2018 16:33:42 +0000 (16:33 +0000)]
Merge cherrypicks of [53132905313323531334353134155313291531344153135575313344531338353133845313324531332553133265313294531329553132965313498] into oc-m8-release

Change-Id: If45233ec1637604dcb769efb42ed3acb1b2857a0

5 years agoCTS error while media dump()
ray-cy.lee [Tue, 7 Mar 2017 10:25:15 +0000 (18:25 +0800)]
CTS error while media dump()

MediaExtractor should not dump information. CTS is
checking and failing due to the dump.

Bug: 114770654
Change-Id: Ie5bae5de39545dede6da4198240b4f38c50050b7
(cherry picked from commit c20825bd3b751cffcd8d7e66e97c3b1a91ef21e0)

5 years agoCTS error while media dump()
ray-cy.lee [Tue, 7 Mar 2017 10:25:15 +0000 (18:25 +0800)]
CTS error while media dump()

MediaExtractor should not dump information. CTS is
checking and failing due to the dump.

Bug: 114770654
Change-Id: Ie5bae5de39545dede6da4198240b4f38c50050b7
(cherry picked from commit c20825bd3b751cffcd8d7e66e97c3b1a91ef21e0)

5 years agoMerge tag 'android-8.1.0_r48' into oreo-x86
Chih-Wei Huang [Tue, 9 Oct 2018 09:51:30 +0000 (17:51 +0800)]
Merge tag 'android-8.1.0_r48' into oreo-x86

Android 8.1.0 release 48

5 years agoMerge cherrypicks of [4995494, 4995495, 4995496, 4995497, 4997652, 4997881, 4997052...
android-build-team Robot [Tue, 11 Sep 2018 23:09:01 +0000 (23:09 +0000)]
Merge cherrypicks of [49954944995495499549649954974997652499788149970524997883499551849976534997654] into oc-m8-release

Change-Id: Ifeba25ced72566a9a3c9d67c288a8e23e4709187

5 years agoFix race condition for cas sessions -- DO NOT MERGE
Chong Zhang [Fri, 24 Aug 2018 21:49:33 +0000 (14:49 -0700)]
Fix race condition for cas sessions -- DO NOT MERGE

Change the session to shared_ptr and use atomic_load/store.

Test: POC; CTS MediaCasTest; CTS MediaDrmClearkeyTest#
testClearKeyPlaybackMpeg2ts
bug: 113027383

Change-Id: I75f4cb33a022f28d45918442d64c5c46df2640ef
(cherry picked from commit 58b9e7d73c9e2a7a7ff11a4584fd1e1105669831)

5 years agoMerge tag 'android-8.1.0_r46' into oreo-x86
Chih-Wei Huang [Mon, 10 Sep 2018 15:49:20 +0000 (23:49 +0800)]
Merge tag 'android-8.1.0_r46' into oreo-x86

Android 8.1.0 Release 46 (OPM6.171019.030.K1)

5 years agoMediaExtractor: stop rendering when an error occurs
akirilov [Mon, 9 Jul 2018 22:28:01 +0000 (15:28 -0700)]
MediaExtractor: stop rendering when an error occurs

Bug: 68664359
Bug: 110435401

Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.StagefrightTest#testStagefright_bug_68664359
Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.StagefrightTest#testStagefright_bug_110435401

Change-Id: Icff96fcaa76a5871e7f175b0384d47d5dca7313f
Merged-In: If1322524fcfebc6c5f139288f044b0189da66c1b
(cherry picked from commit 9bc021a323873091ea98f77b3b3dc4732d1c92e6)

5 years agoFix race condition for cas sessions -- DO NOT MERGE
Chong Zhang [Fri, 24 Aug 2018 21:49:33 +0000 (14:49 -0700)]
Fix race condition for cas sessions -- DO NOT MERGE

Change the session to shared_ptr and use atomic_load/store.

Test: POC; CTS MediaCasTest; CTS MediaDrmClearkeyTest#
testClearKeyPlaybackMpeg2ts
bug: 113027383

Change-Id: I75f4cb33a022f28d45918442d64c5c46df2640ef
(cherry picked from commit 58b9e7d73c9e2a7a7ff11a4584fd1e1105669831)

5 years agoCheck for overflow of crypto size
Marco Nelissen [Tue, 31 Jul 2018 22:12:51 +0000 (15:12 -0700)]
Check for overflow of crypto size

Bug: 111603051
Test: CTS
Change-Id: Ib5b1802b9b35769a25c16e2b977308cf7a810606
(cherry picked from commit d1fd02761236b35a336434367131f71bef7405c9)

5 years agoFix information disclosure in mediadrmserver
Jeff Tinker [Tue, 24 Jul 2018 21:13:13 +0000 (14:13 -0700)]
Fix information disclosure in mediadrmserver

Test:POC provided in bug
Bug:79218474
Change-Id: Iba12c07a5e615f8ed234b01ac53e3559ba9ac12e
(cherry picked from commit c1bf68a8d1321d7cdf7da6933f0b89b171d251c6)

5 years agoRevert "MediaExtractor: stop rendering when an error occurs"
Ryan Longair [Tue, 21 Aug 2018 19:01:16 +0000 (12:01 -0700)]
Revert "MediaExtractor: stop rendering when an error occurs"

This reverts commit f3239784597d0dfd0d8405c9407180d282990806.

5 years agoMerge cherrypicks of [4787660, 4787680, 4787071, 4787700, 4787592, 4787701, 4787720...
android-build-team Robot [Thu, 16 Aug 2018 01:24:50 +0000 (01:24 +0000)]
Merge cherrypicks of [47876604787680478707147877004787592478770147877204787721478707247870734787074478707547870764787077478774047877604787722478772347877244787725478772647877274787728478772947877304787731] into oc-m8-release

Change-Id: Ib832d8162af176e40f54cc889d1872cd6b88990b

5 years agoFix information disclosure in mediadrmserver
Jeff Tinker [Tue, 24 Jul 2018 21:13:13 +0000 (14:13 -0700)]
Fix information disclosure in mediadrmserver

Test:POC provided in bug
Bug:79218474
Change-Id: Iba12c07a5e615f8ed234b01ac53e3559ba9ac12e
(cherry picked from commit c1bf68a8d1321d7cdf7da6933f0b89b171d251c6)

5 years agoCheck for overflow of crypto size
Marco Nelissen [Tue, 31 Jul 2018 22:12:51 +0000 (15:12 -0700)]
Check for overflow of crypto size

Bug: 111603051
Test: CTS
Change-Id: Ib5b1802b9b35769a25c16e2b977308cf7a810606
(cherry picked from commit d1fd02761236b35a336434367131f71bef7405c9)

5 years agoMerge cherrypicks of [4741663, 4741664, 4741665, 4741666, 4743080, 4743081, 4743082...
android-build-team Robot [Fri, 10 Aug 2018 20:32:07 +0000 (20:32 +0000)]
Merge cherrypicks of [474166347416644741665474166647430804743081474308247430834741262474126347412644741265474126647416674743084474124247412434741741474174247417434741744474182247430854741668474133847430554743056474307047430734743075474307647430784743079474316147431624743164474316547431674743168474316947431704741681474168247416834741684474168547416864741687474168847416894741690474169147416924741693474169447416954741696474169747416984741699474324047432414743242474324347417454741823474182447418254741267474126847432444743280474328147432244743203474320447432054741746474174747432454741826474182747418284741829474174847417494741750474323347432824741244474124547412464741247474320647432074743208474320947432104743211474321247432134743214474321547432164743217474321847432194743360474336147433624743363474336447433654743366474336747433684743369474337047433714743372474337347433744743375474337647433774743283474328447418304742501474324647430864743087474337847433794741751] into sparse-4749909-L04200000199131547

Change-Id: I53c14677624d9d0302c5cd665640b43ff1334333

5 years agoM3UParser: handle missing EXT-X-MEDIA URIs
Robert Shih [Thu, 12 Jul 2018 23:17:45 +0000 (16:17 -0700)]
M3UParser: handle missing EXT-X-MEDIA URIs

Bug: 111381540
Test: http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8
Change-Id: I57f6cea59ce4c25267385289ab805eefe74b04ac
(cherry picked from commit b8c3a74de55a76e2ee21c731828a8afca7aa4ae0)

5 years agoAllow kPortModeDynamicANWBuffer for kBufferTypeANWBuffer in useBuffer
Toshikazu Saito [Tue, 10 Jul 2018 06:38:38 +0000 (15:38 +0900)]
Allow kPortModeDynamicANWBuffer for kBufferTypeANWBuffer in useBuffer

Test: play contents
Bug: 77486542
Change-Id: I422d49a137889c417d855ebef954f882f67821ed
(cherry picked from commit d8cbab144398d0e9b3cdc2f8c42b4ea0c921e355)

5 years agoMediaExtractor: stop rendering when an error occurs
akirilov [Mon, 9 Jul 2018 22:28:01 +0000 (15:28 -0700)]
MediaExtractor: stop rendering when an error occurs

Bug: 68664359
Bug: 110435401

Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.StagefrightTest#testStagefright_bug_68664359
Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.StagefrightTest#testStagefright_bug_110435401

Change-Id: Icff96fcaa76a5871e7f175b0384d47d5dca7313f
Merged-In: If1322524fcfebc6c5f139288f044b0189da66c1b
(cherry picked from commit 9bc021a323873091ea98f77b3b3dc4732d1c92e6)

5 years agoFix possible out of bounds read
Marco Nelissen [Fri, 1 Jun 2018 17:48:25 +0000 (10:48 -0700)]
Fix possible out of bounds read

Bug: 78656554
Test: manual
Change-Id: I677f827483dcc80afac57fd7ef6807e633542252
(cherry picked from commit 3762e0615273f25b059556d5b5f65102e9c55c35)

5 years agoOMXNodeInstance: Allow dynamic native handle mode for input buffers
Sanjay Singh [Wed, 23 May 2018 11:35:13 +0000 (17:05 +0530)]
OMXNodeInstance: Allow dynamic native handle mode for input buffers

Some camera implementation uses Dynamic native handle to send input
buffers to OMX HAL. Therefore, these buffers should be allowed.

Bug: 77486542
Bug: 80174666
Bug: 80210572
Bug: 80252747
Test: sts-tradefed run sts -m StsHostTestCases -t android.security.sts.Poc18_06#testPocBug_77486542
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Test: adb shell am instrument -e class android.hardware.cts.CameraTest -w 'android.camera.cts/android.support.test.runner.AndroidJUnitRunner'
Test: adb shell am instrument -e class android.hardware.multiprocess.camera.cts.CameraEvictionTest -w 'android.camera.cts/android.support.test.runner.AndroidJUnitRunner'
Test: Exercise secure playback with Play Movies app.
Test: Record video with Camera app and play it back with Photos app

Change-Id: I1e4eb72e070f4e60ff4df94f9b9d161361828477
(cherry picked from commit bda339098d273066fe50d4cb77503bac5ea4ede0)

5 years agoM3UParser: make url on demand
Robert Shih [Fri, 1 Jun 2018 22:09:21 +0000 (15:09 -0700)]
M3UParser: make url on demand

Bug: 77823362
Test: adb shell am start -a android.intent.action.VIEW -d http://10.42.0.1:8080
Change-Id: Ieaf8a13985277eee5b085ed243205a597627cf5e
(cherry picked from commit 26e236bd426770869644a9962778dedea7bf59be)

5 years agoSpeed up id3v2 unsynchronization
Robert Shih [Wed, 9 May 2018 22:16:17 +0000 (15:16 -0700)]
Speed up id3v2 unsynchronization

Instead of doing many overlapping memmoves, do a single copy pass
that skips over the inserted unsynchronization bytes. For some
files this reduces parsing time from minutes to milliseconds.

Similar to commit 72a43b68da but for v2.2 and v2.3.

Bug: 78029004
Test: poc
Change-Id: I735b7051e77a093d86fb7a3e46209875946225ed
(cherry picked from commit f9d87cc850a589b9b0cc3658cf222187822bcc00)

5 years agoFix security vulnerability in CryptoHal
Jeff Tinker [Thu, 19 Apr 2018 23:23:21 +0000 (16:23 -0700)]
Fix security vulnerability in CryptoHal

CryptoHal was not checking that the memory heap set by setHeap
was the same one that was actually used for the decrypt call, allowing
the caller to spoof the decrypt call into accessing arbitrary memory.

bug:76221123
test: mediadrmserverpoc included in the bug & GTS media tests
Change-Id: I35214a1a6d0a4b864123e147d1a1adc2377bfbc5
Merged-in: I4ae6d1080be406bf53e3617c59c75206cc5066c6
(cherry picked from commit 9a9c3ab4d76f03f3abb3756bca9cdfe55c74326a)

5 years agoomx: restrict useBuffer according to buffer type and port mode
Wonsik Kim [Tue, 1 May 2018 20:18:11 +0000 (13:18 -0700)]
omx: restrict useBuffer according to buffer type and port mode

Bug: 77486542
Test: sts-tradefed run sts -m StsHostTestCases -t android.security.sts.Poc18_06#testPocBug_77486542
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Test: Exercise secure playback with Play Movies app.
Test: Record video with Camera app and play it back with Photos app

Change-Id: Ief2d2d4d0445074c0ecdc723b1b25997a7631389
(cherry picked from commit 7d54e8f905784fddcc4c37fd094d4e18a73767bc)

5 years agoaaudio: use weak pointer to prevent UAF
Phil Burk [Tue, 1 May 2018 20:03:52 +0000 (13:03 -0700)]
aaudio: use weak pointer to prevent UAF

Avoid using the mServiceEndpoint smart pointer
from multiple threads.

Bug: 74122779
Test: see bug for test instructions
Merged-In: Idaf9e32a163b25e51bde35d6f5ea10a372b5d916
Change-Id: Idaf9e32a163b25e51bde35d6f5ea10a372b5d916
(cherry picked from commit 92c3e26338637a7ddac54988187c89fb0fe49430)

5 years agoAdd minimum size check for ImageGrid atom
Chong Zhang [Thu, 19 Apr 2018 17:59:17 +0000 (10:59 -0700)]
Add minimum size check for ImageGrid atom

bug: 73927042
Change-Id: I25dc3aeabe95bd907a418b12b2d06f3691cb1b42
(cherry picked from commit ef75163eb891b5259c0f5c2fc20fca2a5a47b7b7)

5 years agoSanitize effect descriptors for AudioPolicyService binder calls.
Andy Hung [Thu, 12 Apr 2018 18:06:56 +0000 (11:06 -0700)]
Sanitize effect descriptors for AudioPolicyService binder calls.

Zero initialize structs before parcel read, if status is not checked.
Sanitize parcel read audio_port_config.

Test: Audio CTS, See bug for POC
Bug: 73126106
Merged-in: Iece43eb463385927e6babcf93654eea8aaebc29c
Change-Id: Iece43eb463385927e6babcf93654eea8aaebc29c
(cherry picked from commit 498bdcc90bc470a79bf8943cbac64502f7c1c091)

5 years agoAdd check preventing div0 issue
Ryszard Grzesica [Tue, 29 Dec 2015 05:28:44 +0000 (06:28 +0100)]
Add check preventing div0 issue

There might be a scenario while period is zero or after including
precision would be zero, prevent from division in that case and
return false (to use previously used period).

Bug: 73898703
bug: 74067957
Test: run playback as stability test

Change-Id: I3fad1060b095b7b5ea4c1f9cb3f9d42a4c503560
(cherry picked from commit 27e47ce3c3bbc0b4dc629163de7ebbba7e80b149)

5 years agoInit gain config to prevent uninit leak.
jiabin [Fri, 6 Apr 2018 00:16:20 +0000 (17:16 -0700)]
Init gain config to prevent uninit leak.

In AudioPortConfig, we only initialize index for audio_gain_config, but
not other fields. That may cause uninit leak at listAudioPorts and
listAudioPatches.

Bug: 77238250
Bug: 77238762
Test: try repo steps at the bug description.
Change-Id: I57e3bd0598f9aa698a6fa3d3c0218b046de34e2f
(cherry picked from commit ebe0777edcf3b9c6bde9771d65399e2363dc6e40)

5 years agoMerge cherrypicks of [4691111, 4689862, 4690575, 4690576, 4690577, 4690578, 4689866...
android-build-team Robot [Fri, 3 Aug 2018 19:21:17 +0000 (19:21 +0000)]
Merge cherrypicks of [46911114689862469057546905764690577469057846898664689868468986946898704691132468945646899634691133469113446911564691157469115946911614690581468996446894604691112469058246905834691165469116646911674691168469116946911704691211469121246912134691214469121546912164691217469121846912194691232469123346912344691235469123646912374691238469123946912404691241469124346912454691247469124946912504691291469129246912934691294469129546912964691255468947646894774689478469122346912244691136468947946894804691137469122546912264691227469137146912284691328468996746911384691139469114046914334689968468996946913954691230469129746912984691299469130046913964691397469139846913994691400469140146914024691403469140446914054691406469140746914084691409469141046914714691472469147346914744691475469147646914774691478469147946914804691481469148246914834691484469148546914864691487469148846911434691144469151146911134689482469153346911454691146469114746911484691536] into sparse-4732991-L01200000196794104

Change-Id: I066b69b810f0a1acd43176472ac2a3f87c429873

5 years agoM3UParser: handle missing EXT-X-MEDIA URIs
Robert Shih [Thu, 12 Jul 2018 23:17:45 +0000 (16:17 -0700)]
M3UParser: handle missing EXT-X-MEDIA URIs

Bug: 111381540
Test: http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8
Change-Id: I57f6cea59ce4c25267385289ab805eefe74b04ac
(cherry picked from commit b8c3a74de55a76e2ee21c731828a8afca7aa4ae0)

5 years agoAllow kPortModeDynamicANWBuffer for kBufferTypeANWBuffer in useBuffer
Toshikazu Saito [Tue, 10 Jul 2018 06:38:38 +0000 (15:38 +0900)]
Allow kPortModeDynamicANWBuffer for kBufferTypeANWBuffer in useBuffer

Test: play contents
Bug: 77486542
Change-Id: I422d49a137889c417d855ebef954f882f67821ed
(cherry picked from commit d8cbab144398d0e9b3cdc2f8c42b4ea0c921e355)

5 years agoMediaExtractor: stop rendering when an error occurs
akirilov [Mon, 9 Jul 2018 22:28:01 +0000 (15:28 -0700)]
MediaExtractor: stop rendering when an error occurs

Bug: 68664359
Bug: 110435401

Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.StagefrightTest#testStagefright_bug_68664359
Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.StagefrightTest#testStagefright_bug_110435401

Change-Id: Icff96fcaa76a5871e7f175b0384d47d5dca7313f
Merged-In: If1322524fcfebc6c5f139288f044b0189da66c1b
(cherry picked from commit 9bc021a323873091ea98f77b3b3dc4732d1c92e6)

5 years agoFix possible out of bounds read
Marco Nelissen [Fri, 1 Jun 2018 17:48:25 +0000 (10:48 -0700)]
Fix possible out of bounds read

Bug: 78656554
Test: manual
Change-Id: I677f827483dcc80afac57fd7ef6807e633542252
(cherry picked from commit 3762e0615273f25b059556d5b5f65102e9c55c35)

5 years agoOMXNodeInstance: Allow dynamic native handle mode for input buffers
Sanjay Singh [Wed, 23 May 2018 11:35:13 +0000 (17:05 +0530)]
OMXNodeInstance: Allow dynamic native handle mode for input buffers

Some camera implementation uses Dynamic native handle to send input
buffers to OMX HAL. Therefore, these buffers should be allowed.

Bug: 77486542
Bug: 80174666
Bug: 80210572
Bug: 80252747
Test: sts-tradefed run sts -m StsHostTestCases -t android.security.sts.Poc18_06#testPocBug_77486542
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Test: adb shell am instrument -e class android.hardware.cts.CameraTest -w 'android.camera.cts/android.support.test.runner.AndroidJUnitRunner'
Test: adb shell am instrument -e class android.hardware.multiprocess.camera.cts.CameraEvictionTest -w 'android.camera.cts/android.support.test.runner.AndroidJUnitRunner'
Test: Exercise secure playback with Play Movies app.
Test: Record video with Camera app and play it back with Photos app

Change-Id: I1e4eb72e070f4e60ff4df94f9b9d161361828477
(cherry picked from commit bda339098d273066fe50d4cb77503bac5ea4ede0)

5 years agoM3UParser: make url on demand
Robert Shih [Fri, 1 Jun 2018 22:09:21 +0000 (15:09 -0700)]
M3UParser: make url on demand

Bug: 77823362
Test: adb shell am start -a android.intent.action.VIEW -d http://10.42.0.1:8080
Change-Id: Ieaf8a13985277eee5b085ed243205a597627cf5e
(cherry picked from commit 26e236bd426770869644a9962778dedea7bf59be)

5 years agoSpeed up id3v2 unsynchronization
Robert Shih [Wed, 9 May 2018 22:16:17 +0000 (15:16 -0700)]
Speed up id3v2 unsynchronization

Instead of doing many overlapping memmoves, do a single copy pass
that skips over the inserted unsynchronization bytes. For some
files this reduces parsing time from minutes to milliseconds.

Similar to commit 72a43b68da but for v2.2 and v2.3.

Bug: 78029004
Test: poc
Change-Id: I735b7051e77a093d86fb7a3e46209875946225ed
(cherry picked from commit f9d87cc850a589b9b0cc3658cf222187822bcc00)

5 years agoFix security vulnerability in CryptoHal
Jeff Tinker [Thu, 19 Apr 2018 23:23:21 +0000 (16:23 -0700)]
Fix security vulnerability in CryptoHal

CryptoHal was not checking that the memory heap set by setHeap
was the same one that was actually used for the decrypt call, allowing
the caller to spoof the decrypt call into accessing arbitrary memory.

bug:76221123
test: mediadrmserverpoc included in the bug & GTS media tests
Change-Id: I35214a1a6d0a4b864123e147d1a1adc2377bfbc5
Merged-in: I4ae6d1080be406bf53e3617c59c75206cc5066c6
(cherry picked from commit 9a9c3ab4d76f03f3abb3756bca9cdfe55c74326a)

5 years agoomx: restrict useBuffer according to buffer type and port mode
Wonsik Kim [Tue, 1 May 2018 20:18:11 +0000 (13:18 -0700)]
omx: restrict useBuffer according to buffer type and port mode

Bug: 77486542
Test: sts-tradefed run sts -m StsHostTestCases -t android.security.sts.Poc18_06#testPocBug_77486542
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Test: Exercise secure playback with Play Movies app.
Test: Record video with Camera app and play it back with Photos app

Change-Id: Ief2d2d4d0445074c0ecdc723b1b25997a7631389
(cherry picked from commit 7d54e8f905784fddcc4c37fd094d4e18a73767bc)

5 years agoaaudio: use weak pointer to prevent UAF
Phil Burk [Tue, 1 May 2018 20:03:52 +0000 (13:03 -0700)]
aaudio: use weak pointer to prevent UAF

Avoid using the mServiceEndpoint smart pointer
from multiple threads.

Bug: 74122779
Test: see bug for test instructions
Merged-In: Idaf9e32a163b25e51bde35d6f5ea10a372b5d916
Change-Id: Idaf9e32a163b25e51bde35d6f5ea10a372b5d916
(cherry picked from commit 92c3e26338637a7ddac54988187c89fb0fe49430)

5 years agoAdd minimum size check for ImageGrid atom
Chong Zhang [Thu, 19 Apr 2018 17:59:17 +0000 (10:59 -0700)]
Add minimum size check for ImageGrid atom

bug: 73927042
Change-Id: I25dc3aeabe95bd907a418b12b2d06f3691cb1b42
(cherry picked from commit ef75163eb891b5259c0f5c2fc20fca2a5a47b7b7)

5 years agoSanitize effect descriptors for AudioPolicyService binder calls.
Andy Hung [Thu, 12 Apr 2018 18:06:56 +0000 (11:06 -0700)]
Sanitize effect descriptors for AudioPolicyService binder calls.

Zero initialize structs before parcel read, if status is not checked.
Sanitize parcel read audio_port_config.

Test: Audio CTS, See bug for POC
Bug: 73126106
Merged-in: Iece43eb463385927e6babcf93654eea8aaebc29c
Change-Id: Iece43eb463385927e6babcf93654eea8aaebc29c
(cherry picked from commit 498bdcc90bc470a79bf8943cbac64502f7c1c091)

5 years agoAdd check preventing div0 issue
Ryszard Grzesica [Tue, 29 Dec 2015 05:28:44 +0000 (06:28 +0100)]
Add check preventing div0 issue

There might be a scenario while period is zero or after including
precision would be zero, prevent from division in that case and
return false (to use previously used period).

Bug: 73898703
bug: 74067957
Test: run playback as stability test

Change-Id: I3fad1060b095b7b5ea4c1f9cb3f9d42a4c503560
(cherry picked from commit 27e47ce3c3bbc0b4dc629163de7ebbba7e80b149)

5 years agoInit gain config to prevent uninit leak.
jiabin [Fri, 6 Apr 2018 00:16:20 +0000 (17:16 -0700)]
Init gain config to prevent uninit leak.

In AudioPortConfig, we only initialize index for audio_gain_config, but
not other fields. That may cause uninit leak at listAudioPorts and
listAudioPatches.

Bug: 77238250
Bug: 77238762
Test: try repo steps at the bug description.
Change-Id: I57e3bd0598f9aa698a6fa3d3c0218b046de34e2f
(cherry picked from commit ebe0777edcf3b9c6bde9771d65399e2363dc6e40)

5 years agoRefactor MediaPlayerBase's notify
Pawin Vongmasa [Sun, 17 Dec 2017 10:31:18 +0000 (02:31 -0800)]
Refactor MediaPlayerBase's notify

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 70546581
Change-Id: Ia3a8eb99c2faf6935c63800ba08f65970cede48e
(cherry picked from commit 082e4f75a383f957a6ed9186ca0692b694e1ce45)

5 years agoM3UParser: handle missing EXT-X-MEDIA URIs
Robert Shih [Thu, 12 Jul 2018 23:17:45 +0000 (16:17 -0700)]
M3UParser: handle missing EXT-X-MEDIA URIs

Bug: 111381540
Test: http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8
Change-Id: I57f6cea59ce4c25267385289ab805eefe74b04ac
(cherry picked from commit b8c3a74de55a76e2ee21c731828a8afca7aa4ae0)

5 years agoAllow kPortModeDynamicANWBuffer for kBufferTypeANWBuffer in useBuffer
Toshikazu Saito [Tue, 10 Jul 2018 06:38:38 +0000 (15:38 +0900)]
Allow kPortModeDynamicANWBuffer for kBufferTypeANWBuffer in useBuffer

Test: play contents
Bug: 77486542
Change-Id: I422d49a137889c417d855ebef954f882f67821ed
(cherry picked from commit d8cbab144398d0e9b3cdc2f8c42b4ea0c921e355)

5 years agoMediaExtractor: stop rendering when an error occurs
akirilov [Mon, 9 Jul 2018 22:28:01 +0000 (15:28 -0700)]
MediaExtractor: stop rendering when an error occurs

Bug: 68664359
Bug: 110435401

Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.StagefrightTest#testStagefright_bug_68664359
Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.StagefrightTest#testStagefright_bug_110435401

Change-Id: Icff96fcaa76a5871e7f175b0384d47d5dca7313f
Merged-In: If1322524fcfebc6c5f139288f044b0189da66c1b
(cherry picked from commit 9bc021a323873091ea98f77b3b3dc4732d1c92e6)

5 years agoMerge tag 'android-8.1.0_r41' into oreo-x86
Chih-Wei Huang [Fri, 13 Jul 2018 06:38:58 +0000 (14:38 +0800)]
Merge tag 'android-8.1.0_r41' into oreo-x86

Android 8.1.0 Release 41 (OPM6.171019.030.E1)

5 years agoOMXNodeInstance: Allow dynamic native handle mode for input buffers
Sanjay Singh [Wed, 23 May 2018 11:35:13 +0000 (17:05 +0530)]
OMXNodeInstance: Allow dynamic native handle mode for input buffers

Some camera implementation uses Dynamic native handle to send input
buffers to OMX HAL. Therefore, these buffers should be allowed.

Bug: 77486542
Bug: 80174666
Bug: 80210572
Bug: 80252747
Test: sts-tradefed run sts -m StsHostTestCases -t android.security.sts.Poc18_06#testPocBug_77486542
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Test: adb shell am instrument -e class android.hardware.cts.CameraTest -w 'android.camera.cts/android.support.test.runner.AndroidJUnitRunner'
Test: adb shell am instrument -e class android.hardware.multiprocess.camera.cts.CameraEvictionTest -w 'android.camera.cts/android.support.test.runner.AndroidJUnitRunner'
Test: Exercise secure playback with Play Movies app.
Test: Record video with Camera app and play it back with Photos app

Change-Id: I1e4eb72e070f4e60ff4df94f9b9d161361828477
(cherry picked from commit bda339098d273066fe50d4cb77503bac5ea4ede0)

5 years agoFix possible out of bounds read
Marco Nelissen [Fri, 1 Jun 2018 17:48:25 +0000 (10:48 -0700)]
Fix possible out of bounds read

Bug: 78656554
Test: manual
Change-Id: I677f827483dcc80afac57fd7ef6807e633542252
(cherry picked from commit 3762e0615273f25b059556d5b5f65102e9c55c35)

5 years agoM3UParser: make url on demand
Robert Shih [Fri, 1 Jun 2018 22:09:21 +0000 (15:09 -0700)]
M3UParser: make url on demand

Bug: 77823362
Test: adb shell am start -a android.intent.action.VIEW -d http://10.42.0.1:8080
Change-Id: Ieaf8a13985277eee5b085ed243205a597627cf5e
(cherry picked from commit 26e236bd426770869644a9962778dedea7bf59be)

5 years agoMerge tag 'android-8.1.0_r33' into oreo-x86
Chih-Wei Huang [Thu, 14 Jun 2018 09:20:49 +0000 (17:20 +0800)]
Merge tag 'android-8.1.0_r33' into oreo-x86

Android 8.1.0 release 33

5 years agoomx: restrict useBuffer according to buffer type and port mode
Wonsik Kim [Tue, 1 May 2018 20:18:11 +0000 (13:18 -0700)]
omx: restrict useBuffer according to buffer type and port mode

Bug: 77486542
Test: sts-tradefed run sts -m StsHostTestCases -t android.security.sts.Poc18_06#testPocBug_77486542
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Test: Exercise secure playback with Play Movies app.
Test: Record video with Camera app and play it back with Photos app

Change-Id: Ief2d2d4d0445074c0ecdc723b1b25997a7631389
(cherry picked from commit 7d54e8f905784fddcc4c37fd094d4e18a73767bc)

5 years agoMerge cherrypicks of [4195294, 4195296, 4195440, 4195441, 4186165, 4186166, 4186580...
android-build-team Robot [Fri, 25 May 2018 18:43:08 +0000 (18:43 +0000)]
Merge cherrypicks of [41952944195296419544041954414186165418616641865804195442419544341861934186194418619541861964186607419544441952974186608418660941866104186611418661241866134186614418664941866504186651418665241866534186654418665541866564186657419551841955194195520419552141955224186406418640741864084195523419555841955594186197419552441866154195445419544641868294186830418683141868324186833418683441868354186836418683741955784195579419558041955814195447418658141954484195560] into sparse-4749909-L06000000176800346

Change-Id: I8fd2e5330a81cee2c04924c1e775adb07068a021

5 years agoSpeed up id3v2 unsynchronization
Robert Shih [Wed, 9 May 2018 22:16:17 +0000 (15:16 -0700)]
Speed up id3v2 unsynchronization

Instead of doing many overlapping memmoves, do a single copy pass
that skips over the inserted unsynchronization bytes. For some
files this reduces parsing time from minutes to milliseconds.

Similar to commit 72a43b68da but for v2.2 and v2.3.

Bug: 78029004
Test: poc
Change-Id: I735b7051e77a093d86fb7a3e46209875946225ed
(cherry picked from commit f9d87cc850a589b9b0cc3658cf222187822bcc00)

5 years agoFix security vulnerability in CryptoHal
Jeff Tinker [Thu, 19 Apr 2018 23:23:21 +0000 (16:23 -0700)]
Fix security vulnerability in CryptoHal

CryptoHal was not checking that the memory heap set by setHeap
was the same one that was actually used for the decrypt call, allowing
the caller to spoof the decrypt call into accessing arbitrary memory.

bug:76221123
test: mediadrmserverpoc included in the bug & GTS media tests
Change-Id: I35214a1a6d0a4b864123e147d1a1adc2377bfbc5
Merged-in: I4ae6d1080be406bf53e3617c59c75206cc5066c6
(cherry picked from commit 9a9c3ab4d76f03f3abb3756bca9cdfe55c74326a)

5 years agoaaudio: use weak pointer to prevent UAF
Phil Burk [Tue, 1 May 2018 20:03:52 +0000 (13:03 -0700)]
aaudio: use weak pointer to prevent UAF

Avoid using the mServiceEndpoint smart pointer
from multiple threads.

Bug: 74122779
Test: see bug for test instructions
Merged-In: Idaf9e32a163b25e51bde35d6f5ea10a372b5d916
Change-Id: Idaf9e32a163b25e51bde35d6f5ea10a372b5d916
(cherry picked from commit 92c3e26338637a7ddac54988187c89fb0fe49430)

5 years agoAdd minimum size check for ImageGrid atom
Chong Zhang [Thu, 19 Apr 2018 17:59:17 +0000 (10:59 -0700)]
Add minimum size check for ImageGrid atom

bug: 73927042
Change-Id: I25dc3aeabe95bd907a418b12b2d06f3691cb1b42
(cherry picked from commit ef75163eb891b5259c0f5c2fc20fca2a5a47b7b7)

5 years agoSanitize effect descriptors for AudioPolicyService binder calls.
Andy Hung [Thu, 12 Apr 2018 18:06:56 +0000 (11:06 -0700)]
Sanitize effect descriptors for AudioPolicyService binder calls.

Zero initialize structs before parcel read, if status is not checked.
Sanitize parcel read audio_port_config.

Test: Audio CTS, See bug for POC
Bug: 73126106
Merged-in: Iece43eb463385927e6babcf93654eea8aaebc29c
Change-Id: Iece43eb463385927e6babcf93654eea8aaebc29c
(cherry picked from commit 498bdcc90bc470a79bf8943cbac64502f7c1c091)

5 years agoAdd check preventing div0 issue
Ryszard Grzesica [Tue, 29 Dec 2015 05:28:44 +0000 (06:28 +0100)]
Add check preventing div0 issue

There might be a scenario while period is zero or after including
precision would be zero, prevent from division in that case and
return false (to use previously used period).

Bug: 73898703
bug: 74067957
Test: run playback as stability test

Change-Id: I3fad1060b095b7b5ea4c1f9cb3f9d42a4c503560
(cherry picked from commit 27e47ce3c3bbc0b4dc629163de7ebbba7e80b149)

5 years agoInit gain config to prevent uninit leak.
jiabin [Fri, 6 Apr 2018 00:16:20 +0000 (17:16 -0700)]
Init gain config to prevent uninit leak.

In AudioPortConfig, we only initialize index for audio_gain_config, but
not other fields. That may cause uninit leak at listAudioPorts and
listAudioPatches.

Bug: 77238250
Bug: 77238762
Test: try repo steps at the bug description.
Change-Id: I57e3bd0598f9aa698a6fa3d3c0218b046de34e2f
(cherry picked from commit ebe0777edcf3b9c6bde9771d65399e2363dc6e40)

5 years agoMerge tag 'android-8.1.0_r29' into oreo-x86
Chih-Wei Huang [Fri, 25 May 2018 09:06:32 +0000 (17:06 +0800)]
Merge tag 'android-8.1.0_r29' into oreo-x86

Android 8.1.0 Release 29 (OPM4.171019.016.C1)

5 years agoRevert "Refactor MediaPlayerBase's notify"
Chih-Wei Huang [Fri, 25 May 2018 09:06:21 +0000 (17:06 +0800)]
Revert "Refactor MediaPlayerBase's notify"

This reverts commit 8a54af87b632c03ff2ae15a4a088801bb39fdae7.

5 years agoFix security vulnerability in CryptoHal
Jeff Tinker [Thu, 19 Apr 2018 23:23:21 +0000 (16:23 -0700)]
Fix security vulnerability in CryptoHal

CryptoHal was not checking that the memory heap set by setHeap
was the same one that was actually used for the decrypt call, allowing
the caller to spoof the decrypt call into accessing arbitrary memory.

bug:76221123
test: mediadrmserverpoc included in the bug & GTS media tests
Change-Id: I35214a1a6d0a4b864123e147d1a1adc2377bfbc5
Merged-in: I4ae6d1080be406bf53e3617c59c75206cc5066c6
(cherry picked from commit 9a9c3ab4d76f03f3abb3756bca9cdfe55c74326a)

5 years agoSpeed up id3v2 unsynchronization
Robert Shih [Wed, 9 May 2018 22:16:17 +0000 (15:16 -0700)]
Speed up id3v2 unsynchronization

Instead of doing many overlapping memmoves, do a single copy pass
that skips over the inserted unsynchronization bytes. For some
files this reduces parsing time from minutes to milliseconds.

Similar to commit 72a43b68da but for v2.2 and v2.3.

Bug: 78029004
Test: poc
Change-Id: I735b7051e77a093d86fb7a3e46209875946225ed
(cherry picked from commit f9d87cc850a589b9b0cc3658cf222187822bcc00)

5 years agoaaudio: use weak pointer to prevent UAF
Phil Burk [Tue, 1 May 2018 20:03:52 +0000 (13:03 -0700)]
aaudio: use weak pointer to prevent UAF

Avoid using the mServiceEndpoint smart pointer
from multiple threads.

Bug: 74122779
Test: see bug for test instructions
Merged-In: Idaf9e32a163b25e51bde35d6f5ea10a372b5d916
Change-Id: Idaf9e32a163b25e51bde35d6f5ea10a372b5d916
(cherry picked from commit 92c3e26338637a7ddac54988187c89fb0fe49430)

5 years agoAdd minimum size check for ImageGrid atom
Chong Zhang [Thu, 19 Apr 2018 17:59:17 +0000 (10:59 -0700)]
Add minimum size check for ImageGrid atom

bug: 73927042
Change-Id: I25dc3aeabe95bd907a418b12b2d06f3691cb1b42
(cherry picked from commit ef75163eb891b5259c0f5c2fc20fca2a5a47b7b7)

5 years agoFFMPEGSoftCodec: fix FFMPEG plugin loading issue
Chih-Wei Huang [Thu, 13 Apr 2017 17:30:46 +0000 (01:30 +0800)]
FFMPEGSoftCodec: fix FFMPEG plugin loading issue

It's incorrect to check if dlopen() is successfully by dlerror().
According to man dlerror, it may return the most recent error since
the last call to dlerror(). It may not be the error of the last
dlopen() call.

Just check the return value of dlopen() to avoid the error:

04-13 16:39:36.430  1500  1500 E FFMPEGSoftCodec: Failed to load FFMPEG plugin: (null)

5 years agostagefright: Trivial FFMPEG fixes
Steve Kondik [Wed, 28 Sep 2016 10:44:50 +0000 (03:44 -0700)]
stagefright: Trivial FFMPEG fixes

 * Ensure our codecs are never touched for encoders
 * Don't duplicate InitOMXParams, use utility class

Change-Id: Icde45b4d8b844fdb52b4f11a862ecb57059d17c0

5 years agostagefright: Copy the thumbnail time
Steve Kondik [Sun, 27 Dec 2015 00:52:22 +0000 (16:52 -0800)]
stagefright: Copy the thumbnail time

 * In case we do a conversion, we need this to seek the extractor
   to the right position for extracting a thumbnail.

Change-Id: I003a599c15890aeeb6d2494b219f170ba5b278d8

5 years agoMerge cherrypicks of [4025538, 4025981, 4025580, 4024762, 4024763, 4025174, 4026015...
android-build-team Robot [Tue, 8 May 2018 19:01:14 +0000 (19:01 +0000)]
Merge cherrypicks of [40255384025981402558040247624024763402517440260154026016402570440259834025597402598640259884025990402438640243874024388402438940243904024391402439240247664026038402476740260394026040402604140260424026043402604440260454026046402604740260484025720] into sparse-4749909-L37000000170952244

Change-Id: I2b179335f01e852565e908036e1df711c2be780c

5 years agoSanitize effect descriptors for AudioPolicyService binder calls.
Andy Hung [Thu, 12 Apr 2018 18:06:56 +0000 (11:06 -0700)]
Sanitize effect descriptors for AudioPolicyService binder calls.

Zero initialize structs before parcel read, if status is not checked.
Sanitize parcel read audio_port_config.

Test: Audio CTS, See bug for POC
Bug: 73126106
Merged-in: Iece43eb463385927e6babcf93654eea8aaebc29c
Change-Id: Iece43eb463385927e6babcf93654eea8aaebc29c
(cherry picked from commit 498bdcc90bc470a79bf8943cbac64502f7c1c091)