diff options
author | Eric Laurent <elaurent@google.com> | 2014-11-10 23:28:27 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-10 23:28:27 +0000 |
commit | 99370d2da54d7537ffda7fef1f6ef36f8b690321 (patch) | |
tree | 1ba4953c98fd3eeaa6f9a3fc2ab3e88003da23e4 /media | |
parent | ca83dd27f6c662bcbb0cea204c4df7ca77a479fd (diff) | |
parent | ae6965ae7664aaea489a8d58358035610075c9af (diff) | |
download | frameworks_av-99370d2da54d7537ffda7fef1f6ef36f8b690321.zip frameworks_av-99370d2da54d7537ffda7fef1f6ef36f8b690321.tar.gz frameworks_av-99370d2da54d7537ffda7fef1f6ef36f8b690321.tar.bz2 |
am ae6965ae: am 3aef3560: am e360f0f6: IAudioPolicyService: bound array size in queryDefaultPreProcessing
* commit 'ae6965ae7664aaea489a8d58358035610075c9af':
IAudioPolicyService: bound array size in queryDefaultPreProcessing
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/IAudioPolicyService.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/media/libmedia/IAudioPolicyService.cpp b/media/libmedia/IAudioPolicyService.cpp index 4be3c09..9ffc486 100644 --- a/media/libmedia/IAudioPolicyService.cpp +++ b/media/libmedia/IAudioPolicyService.cpp @@ -23,6 +23,7 @@ #include <binder/Parcel.h> +#include <media/AudioEffect.h> #include <media/IAudioPolicyService.h> #include <system/audio.h> @@ -656,16 +657,18 @@ status_t BnAudioPolicyService::onTransact( CHECK_INTERFACE(IAudioPolicyService, data, reply); int audioSession = data.readInt32(); uint32_t count = data.readInt32(); + if (count > AudioEffect::kMaxPreProcessing) { + count = AudioEffect::kMaxPreProcessing; + } uint32_t retCount = count; - effect_descriptor_t *descriptors = - (effect_descriptor_t *)new char[count * sizeof(effect_descriptor_t)]; + effect_descriptor_t *descriptors = new effect_descriptor_t[count]; status_t status = queryDefaultPreProcessing(audioSession, descriptors, &retCount); reply->writeInt32(status); if (status != NO_ERROR && status != NO_MEMORY) { retCount = 0; } reply->writeInt32(retCount); - if (retCount) { + if (retCount != 0) { if (retCount < count) { count = retCount; } |