Fix array out of bound in audioTransportToHal.

The number of audio profile and extra audio descriptor must not be
greater than the maximum value.

Bug: 237288416
Bug: 237717857
Test: repo step in bug
Test: atest android.hardware.audio.common@7.0-util_tests
Change-Id: I1fcfa29d7841a1cb73bafb1ea92f3b1630992ae9
Merged-In: I1fcfa29d7841a1cb73bafb1ea92f3b1630992ae9
(cherry picked from commit 0ee75ca925f6334741d3e34c5e1d1b0efae5943b)
(cherry picked from commit f16c6d3a5741768356159f099d04bfe2219c81fe)
Merged-In: I1fcfa29d7841a1cb73bafb1ea92f3b1630992ae9
2 files changed