diff options
author | Wei Jia <wjia@google.com> | 2015-09-21 19:06:15 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-21 19:06:15 +0000 |
commit | fe0960023b5e24cfe233420eb78be20969a782f1 (patch) | |
tree | ebd24c0ccccffd4a1666e25d4f70bd13127fc496 | |
parent | 7b642b085413ffd92caa07933b21bc00b55f9905 (diff) | |
parent | dae1d8ddfca7ca8cb3134116280c3a0c0dc1b2bf (diff) | |
download | frameworks_av-fe0960023b5e24cfe233420eb78be20969a782f1.zip frameworks_av-fe0960023b5e24cfe233420eb78be20969a782f1.tar.gz frameworks_av-fe0960023b5e24cfe233420eb78be20969a782f1.tar.bz2 |
am dae1d8dd: am 5d76aca5: am 21fda3ed: Merge "DO NOT MERGE - IAudioFlinger: always initialize variables to ensure no info leak when writing them to Parcel." into lmp-dev
* commit 'dae1d8ddfca7ca8cb3134116280c3a0c0dc1b2bf':
DO NOT MERGE - IAudioFlinger: always initialize variables to ensure no info leak when writing them to Parcel.
-rw-r--r-- | media/libmedia/IAudioFlinger.cpp | 22 | ||||
-rw-r--r-- | media/libmedia/IAudioPolicyService.cpp | 6 |
2 files changed, 14 insertions, 14 deletions
diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp index d31de58..a6ed199 100644 --- a/media/libmedia/IAudioFlinger.cpp +++ b/media/libmedia/IAudioFlinger.cpp @@ -924,7 +924,7 @@ status_t BnAudioFlinger::onTransact( pid_t tid = (pid_t) data.readInt32(); int sessionId = data.readInt32(); int clientUid = data.readInt32(); - status_t status; + status_t status = NO_ERROR; sp<IAudioTrack> track; if ((haveSharedBuffer && (buffer == 0)) || ((buffer != 0) && (buffer->pointer() == NULL))) { @@ -957,7 +957,7 @@ status_t BnAudioFlinger::onTransact( size_t notificationFrames = data.readInt64(); sp<IMemory> cblk; sp<IMemory> buffers; - status_t status; + status_t status = NO_ERROR; sp<IAudioRecord> record = openRecord(input, sampleRate, format, channelMask, &frameCount, &flags, tid, &sessionId, ¬ificationFrames, @@ -1097,7 +1097,7 @@ status_t BnAudioFlinger::onTransact( audio_devices_t devices = (audio_devices_t)data.readInt32(); String8 address(data.readString8()); audio_output_flags_t flags = (audio_output_flags_t) data.readInt32(); - uint32_t latencyMs; + uint32_t latencyMs = 0; audio_io_handle_t output; status_t status = openOutput(module, &output, &config, &devices, address, &latencyMs, flags); @@ -1176,8 +1176,8 @@ status_t BnAudioFlinger::onTransact( case GET_RENDER_POSITION: { CHECK_INTERFACE(IAudioFlinger, data, reply); audio_io_handle_t output = (audio_io_handle_t) data.readInt32(); - uint32_t halFrames; - uint32_t dspFrames; + uint32_t halFrames = 0; + uint32_t dspFrames = 0; status_t status = getRenderPosition(&halFrames, &dspFrames, output); reply->writeInt32(status); if (status == NO_ERROR) { @@ -1213,7 +1213,7 @@ status_t BnAudioFlinger::onTransact( } break; case QUERY_NUM_EFFECTS: { CHECK_INTERFACE(IAudioFlinger, data, reply); - uint32_t numEffects; + uint32_t numEffects = 0; status_t status = queryNumberEffects(&numEffects); reply->writeInt32(status); if (status == NO_ERROR) { @@ -1223,7 +1223,7 @@ status_t BnAudioFlinger::onTransact( } case QUERY_EFFECT: { CHECK_INTERFACE(IAudioFlinger, data, reply); - effect_descriptor_t desc; + effect_descriptor_t desc = {}; status_t status = queryEffect(data.readInt32(), &desc); reply->writeInt32(status); if (status == NO_ERROR) { @@ -1235,7 +1235,7 @@ status_t BnAudioFlinger::onTransact( CHECK_INTERFACE(IAudioFlinger, data, reply); effect_uuid_t uuid; data.read(&uuid, sizeof(effect_uuid_t)); - effect_descriptor_t desc; + effect_descriptor_t desc = {}; status_t status = getEffectDescriptor(&uuid, &desc); reply->writeInt32(status); if (status == NO_ERROR) { @@ -1253,9 +1253,9 @@ status_t BnAudioFlinger::onTransact( int32_t priority = data.readInt32(); audio_io_handle_t output = (audio_io_handle_t) data.readInt32(); int sessionId = data.readInt32(); - status_t status; - int id; - int enabled; + status_t status = NO_ERROR; + int id = 0; + int enabled = 0; sp<IEffect> effect = createEffect(&desc, client, priority, output, sessionId, &status, &id, &enabled); diff --git a/media/libmedia/IAudioPolicyService.cpp b/media/libmedia/IAudioPolicyService.cpp index f69a647..56c8f3d 100644 --- a/media/libmedia/IAudioPolicyService.cpp +++ b/media/libmedia/IAudioPolicyService.cpp @@ -1173,9 +1173,9 @@ status_t BnAudioPolicyService::onTransact( CHECK_INTERFACE(IAudioPolicyService, data, reply); sp<IAudioPolicyServiceClient> client = interface_cast<IAudioPolicyServiceClient>( data.readStrongBinder()); - audio_session_t session; - audio_io_handle_t ioHandle; - audio_devices_t device; + audio_session_t session = {}; + audio_io_handle_t ioHandle = {}; + audio_devices_t device = {}; status_t status = acquireSoundTriggerSession(&session, &ioHandle, &device); reply->writeInt32(status); if (status == NO_ERROR) { |