• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/av


Commit MetaInfo

Revisiónb7903b47f9ac2b5a0602fe5978cf8d5842b03a23 (tree)
Tiempo2015-09-29 08:28:21
AutorWei Jia <wjia@goog...>
CommiterThe Android Automerger

Log Message

DO NOT MERGE - IAudioFlinger: always initialize variables to ensure no info leak when writing them to Parcel.

Bug: 23953967
Change-Id: Ibbe841da149038675e9e8daea76c77558bc8564b
(cherry picked from commit 983dca391a76fb45df999fc40e8766b9ddb63511)

Cambiar Resumen

Diferencia incremental

--- a/media/libmedia/IAudioFlinger.cpp
+++ b/media/libmedia/IAudioFlinger.cpp
@@ -924,7 +924,7 @@ status_t BnAudioFlinger::onTransact(
924924 pid_t tid = (pid_t) data.readInt32();
925925 int sessionId = data.readInt32();
926926 int clientUid = data.readInt32();
927- status_t status;
927+ status_t status = NO_ERROR;
928928 sp<IAudioTrack> track;
929929 if ((haveSharedBuffer && (buffer == 0)) ||
930930 ((buffer != 0) && (buffer->pointer() == NULL))) {
@@ -957,7 +957,7 @@ status_t BnAudioFlinger::onTransact(
957957 size_t notificationFrames = data.readInt64();
958958 sp<IMemory> cblk;
959959 sp<IMemory> buffers;
960- status_t status;
960+ status_t status = NO_ERROR;
961961 sp<IAudioRecord> record = openRecord(input,
962962 sampleRate, format, channelMask, &frameCount, &flags, tid, &sessionId,
963963 &notificationFrames,
@@ -1097,7 +1097,7 @@ status_t BnAudioFlinger::onTransact(
10971097 audio_devices_t devices = (audio_devices_t)data.readInt32();
10981098 String8 address(data.readString8());
10991099 audio_output_flags_t flags = (audio_output_flags_t) data.readInt32();
1100- uint32_t latencyMs;
1100+ uint32_t latencyMs = 0;
11011101 audio_io_handle_t output;
11021102 status_t status = openOutput(module, &output, &config,
11031103 &devices, address, &latencyMs, flags);
@@ -1176,8 +1176,8 @@ status_t BnAudioFlinger::onTransact(
11761176 case GET_RENDER_POSITION: {
11771177 CHECK_INTERFACE(IAudioFlinger, data, reply);
11781178 audio_io_handle_t output = (audio_io_handle_t) data.readInt32();
1179- uint32_t halFrames;
1180- uint32_t dspFrames;
1179+ uint32_t halFrames = 0;
1180+ uint32_t dspFrames = 0;
11811181 status_t status = getRenderPosition(&halFrames, &dspFrames, output);
11821182 reply->writeInt32(status);
11831183 if (status == NO_ERROR) {
@@ -1213,7 +1213,7 @@ status_t BnAudioFlinger::onTransact(
12131213 } break;
12141214 case QUERY_NUM_EFFECTS: {
12151215 CHECK_INTERFACE(IAudioFlinger, data, reply);
1216- uint32_t numEffects;
1216+ uint32_t numEffects = 0;
12171217 status_t status = queryNumberEffects(&numEffects);
12181218 reply->writeInt32(status);
12191219 if (status == NO_ERROR) {
@@ -1223,7 +1223,7 @@ status_t BnAudioFlinger::onTransact(
12231223 }
12241224 case QUERY_EFFECT: {
12251225 CHECK_INTERFACE(IAudioFlinger, data, reply);
1226- effect_descriptor_t desc;
1226+ effect_descriptor_t desc = {};
12271227 status_t status = queryEffect(data.readInt32(), &desc);
12281228 reply->writeInt32(status);
12291229 if (status == NO_ERROR) {
@@ -1235,7 +1235,7 @@ status_t BnAudioFlinger::onTransact(
12351235 CHECK_INTERFACE(IAudioFlinger, data, reply);
12361236 effect_uuid_t uuid;
12371237 data.read(&uuid, sizeof(effect_uuid_t));
1238- effect_descriptor_t desc;
1238+ effect_descriptor_t desc = {};
12391239 status_t status = getEffectDescriptor(&uuid, &desc);
12401240 reply->writeInt32(status);
12411241 if (status == NO_ERROR) {
@@ -1253,9 +1253,9 @@ status_t BnAudioFlinger::onTransact(
12531253 int32_t priority = data.readInt32();
12541254 audio_io_handle_t output = (audio_io_handle_t) data.readInt32();
12551255 int sessionId = data.readInt32();
1256- status_t status;
1257- int id;
1258- int enabled;
1256+ status_t status = NO_ERROR;
1257+ int id = 0;
1258+ int enabled = 0;
12591259
12601260 sp<IEffect> effect = createEffect(&desc, client, priority, output, sessionId,
12611261 &status, &id, &enabled);
--- a/media/libmedia/IAudioPolicyService.cpp
+++ b/media/libmedia/IAudioPolicyService.cpp
@@ -1173,9 +1173,9 @@ status_t BnAudioPolicyService::onTransact(
11731173 CHECK_INTERFACE(IAudioPolicyService, data, reply);
11741174 sp<IAudioPolicyServiceClient> client = interface_cast<IAudioPolicyServiceClient>(
11751175 data.readStrongBinder());
1176- audio_session_t session;
1177- audio_io_handle_t ioHandle;
1178- audio_devices_t device;
1176+ audio_session_t session = {};
1177+ audio_io_handle_t ioHandle = {};
1178+ audio_devices_t device = {};
11791179 status_t status = acquireSoundTriggerSession(&session, &ioHandle, &device);
11801180 reply->writeInt32(status);
11811181 if (status == NO_ERROR) {