diff options
author | Eric Laurent <elaurent@google.com> | 2014-09-12 16:19:41 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-09-12 16:22:00 -0700 |
commit | 58f8eb7ae0ee400585bce6682a7212575115e758 (patch) | |
tree | 0ae4991790b2292ba84f05085cdfa2db0a9f3761 /services | |
parent | 7c12b0358b6d3b66e231fe4a67bb55f424b3857e (diff) | |
download | frameworks_av-58f8eb7ae0ee400585bce6682a7212575115e758.zip frameworks_av-58f8eb7ae0ee400585bce6682a7212575115e758.tar.gz frameworks_av-58f8eb7ae0ee400585bce6682a7212575115e758.tar.bz2 |
audio policy: fix check in creaateAudioPatch()
Bug: 17488759.
Change-Id: I9dd2c3ca7f83de4b3573f4fb0e9934e1bc37c3bc
Diffstat (limited to 'services')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index 22c4e04..abdbc5c 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -2294,14 +2294,14 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch, } sp<DeviceDescriptor> srcDeviceDesc = mAvailableInputDevices.getDeviceFromId(patch->sources[0].id); + if (srcDeviceDesc == 0) { + return BAD_VALUE; + } //update source and sink with our own data as the data passed in the patch may // be incomplete. struct audio_patch newPatch = *patch; srcDeviceDesc->toAudioPortConfig(&newPatch.sources[0], &patch->sources[0]); - if (srcDeviceDesc == 0) { - return BAD_VALUE; - } for (size_t i = 0; i < patch->num_sinks; i++) { if (patch->sinks[i].type != AUDIO_PORT_TYPE_DEVICE) { |