frameworks/av
Revisión | b7903b47f9ac2b5a0602fe5978cf8d5842b03a23 (tree) |
---|---|
Tiempo | 2015-09-29 08:28:21 |
Autor | Wei Jia <wjia@goog...> |
Commiter | The Android Automerger |
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)
@@ -924,7 +924,7 @@ status_t BnAudioFlinger::onTransact( | ||
924 | 924 | pid_t tid = (pid_t) data.readInt32(); |
925 | 925 | int sessionId = data.readInt32(); |
926 | 926 | int clientUid = data.readInt32(); |
927 | - status_t status; | |
927 | + status_t status = NO_ERROR; | |
928 | 928 | sp<IAudioTrack> track; |
929 | 929 | if ((haveSharedBuffer && (buffer == 0)) || |
930 | 930 | ((buffer != 0) && (buffer->pointer() == NULL))) { |
@@ -957,7 +957,7 @@ status_t BnAudioFlinger::onTransact( | ||
957 | 957 | size_t notificationFrames = data.readInt64(); |
958 | 958 | sp<IMemory> cblk; |
959 | 959 | sp<IMemory> buffers; |
960 | - status_t status; | |
960 | + status_t status = NO_ERROR; | |
961 | 961 | sp<IAudioRecord> record = openRecord(input, |
962 | 962 | sampleRate, format, channelMask, &frameCount, &flags, tid, &sessionId, |
963 | 963 | ¬ificationFrames, |
@@ -1097,7 +1097,7 @@ status_t BnAudioFlinger::onTransact( | ||
1097 | 1097 | audio_devices_t devices = (audio_devices_t)data.readInt32(); |
1098 | 1098 | String8 address(data.readString8()); |
1099 | 1099 | audio_output_flags_t flags = (audio_output_flags_t) data.readInt32(); |
1100 | - uint32_t latencyMs; | |
1100 | + uint32_t latencyMs = 0; | |
1101 | 1101 | audio_io_handle_t output; |
1102 | 1102 | status_t status = openOutput(module, &output, &config, |
1103 | 1103 | &devices, address, &latencyMs, flags); |
@@ -1176,8 +1176,8 @@ status_t BnAudioFlinger::onTransact( | ||
1176 | 1176 | case GET_RENDER_POSITION: { |
1177 | 1177 | CHECK_INTERFACE(IAudioFlinger, data, reply); |
1178 | 1178 | 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; | |
1181 | 1181 | status_t status = getRenderPosition(&halFrames, &dspFrames, output); |
1182 | 1182 | reply->writeInt32(status); |
1183 | 1183 | if (status == NO_ERROR) { |
@@ -1213,7 +1213,7 @@ status_t BnAudioFlinger::onTransact( | ||
1213 | 1213 | } break; |
1214 | 1214 | case QUERY_NUM_EFFECTS: { |
1215 | 1215 | CHECK_INTERFACE(IAudioFlinger, data, reply); |
1216 | - uint32_t numEffects; | |
1216 | + uint32_t numEffects = 0; | |
1217 | 1217 | status_t status = queryNumberEffects(&numEffects); |
1218 | 1218 | reply->writeInt32(status); |
1219 | 1219 | if (status == NO_ERROR) { |
@@ -1223,7 +1223,7 @@ status_t BnAudioFlinger::onTransact( | ||
1223 | 1223 | } |
1224 | 1224 | case QUERY_EFFECT: { |
1225 | 1225 | CHECK_INTERFACE(IAudioFlinger, data, reply); |
1226 | - effect_descriptor_t desc; | |
1226 | + effect_descriptor_t desc = {}; | |
1227 | 1227 | status_t status = queryEffect(data.readInt32(), &desc); |
1228 | 1228 | reply->writeInt32(status); |
1229 | 1229 | if (status == NO_ERROR) { |
@@ -1235,7 +1235,7 @@ status_t BnAudioFlinger::onTransact( | ||
1235 | 1235 | CHECK_INTERFACE(IAudioFlinger, data, reply); |
1236 | 1236 | effect_uuid_t uuid; |
1237 | 1237 | data.read(&uuid, sizeof(effect_uuid_t)); |
1238 | - effect_descriptor_t desc; | |
1238 | + effect_descriptor_t desc = {}; | |
1239 | 1239 | status_t status = getEffectDescriptor(&uuid, &desc); |
1240 | 1240 | reply->writeInt32(status); |
1241 | 1241 | if (status == NO_ERROR) { |
@@ -1253,9 +1253,9 @@ status_t BnAudioFlinger::onTransact( | ||
1253 | 1253 | int32_t priority = data.readInt32(); |
1254 | 1254 | audio_io_handle_t output = (audio_io_handle_t) data.readInt32(); |
1255 | 1255 | 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; | |
1259 | 1259 | |
1260 | 1260 | sp<IEffect> effect = createEffect(&desc, client, priority, output, sessionId, |
1261 | 1261 | &status, &id, &enabled); |
@@ -1173,9 +1173,9 @@ status_t BnAudioPolicyService::onTransact( | ||
1173 | 1173 | CHECK_INTERFACE(IAudioPolicyService, data, reply); |
1174 | 1174 | sp<IAudioPolicyServiceClient> client = interface_cast<IAudioPolicyServiceClient>( |
1175 | 1175 | 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 = {}; | |
1179 | 1179 | status_t status = acquireSoundTriggerSession(&session, &ioHandle, &device); |
1180 | 1180 | reply->writeInt32(status); |
1181 | 1181 | if (status == NO_ERROR) { |