frameworks/av
Revisión | 8a9a159770047b354d8361d8f43655badafd3f37 (tree) |
---|---|
Tiempo | 2015-09-29 08:27:24 |
Autor | Wei Jia <wjia@goog...> |
Commiter | The Android Automerger |
DO NOT MERGE - IAudioFlinger: clear config before reading it from parcel.
Bug: 23905951
Bug: 23912202
Change-Id: Id13a9d3cae2c09e7381b841e67ddfb188274d74c
(cherry picked from commit e995e477ad59b79145200c8f1e9e13c16c682d59)
@@ -1090,8 +1090,10 @@ status_t BnAudioFlinger::onTransact( | ||
1090 | 1090 | case OPEN_OUTPUT: { |
1091 | 1091 | CHECK_INTERFACE(IAudioFlinger, data, reply); |
1092 | 1092 | audio_module_handle_t module = (audio_module_handle_t)data.readInt32(); |
1093 | - audio_config_t config; | |
1094 | - data.read(&config, sizeof(audio_config_t)); | |
1093 | + audio_config_t config = {}; | |
1094 | + if (data.read(&config, sizeof(audio_config_t)) != NO_ERROR) { | |
1095 | + ALOGE("b/23905951"); | |
1096 | + } | |
1095 | 1097 | audio_devices_t devices = (audio_devices_t)data.readInt32(); |
1096 | 1098 | String8 address(data.readString8()); |
1097 | 1099 | audio_output_flags_t flags = (audio_output_flags_t) data.readInt32(); |
@@ -1135,8 +1137,10 @@ status_t BnAudioFlinger::onTransact( | ||
1135 | 1137 | CHECK_INTERFACE(IAudioFlinger, data, reply); |
1136 | 1138 | audio_module_handle_t module = (audio_module_handle_t)data.readInt32(); |
1137 | 1139 | audio_io_handle_t input = (audio_io_handle_t)data.readInt32(); |
1138 | - audio_config_t config; | |
1139 | - data.read(&config, sizeof(audio_config_t)); | |
1140 | + audio_config_t config = {}; | |
1141 | + if (data.read(&config, sizeof(audio_config_t)) != NO_ERROR) { | |
1142 | + ALOGE("b/23905951"); | |
1143 | + } | |
1140 | 1144 | audio_devices_t device = (audio_devices_t)data.readInt32(); |
1141 | 1145 | String8 address(data.readString8()); |
1142 | 1146 | audio_source_t source = (audio_source_t)data.readInt32(); |
@@ -1241,8 +1245,10 @@ status_t BnAudioFlinger::onTransact( | ||
1241 | 1245 | } |
1242 | 1246 | case CREATE_EFFECT: { |
1243 | 1247 | CHECK_INTERFACE(IAudioFlinger, data, reply); |
1244 | - effect_descriptor_t desc; | |
1245 | - data.read(&desc, sizeof(effect_descriptor_t)); | |
1248 | + effect_descriptor_t desc = {}; | |
1249 | + if (data.read(&desc, sizeof(effect_descriptor_t)) != NO_ERROR) { | |
1250 | + ALOGE("b/23905951"); | |
1251 | + } | |
1246 | 1252 | sp<IEffectClient> client = interface_cast<IEffectClient>(data.readStrongBinder()); |
1247 | 1253 | int32_t priority = data.readInt32(); |
1248 | 1254 | audio_io_handle_t output = (audio_io_handle_t) data.readInt32(); |
@@ -1318,8 +1324,10 @@ status_t BnAudioFlinger::onTransact( | ||
1318 | 1324 | } break; |
1319 | 1325 | case GET_AUDIO_PORT: { |
1320 | 1326 | CHECK_INTERFACE(IAudioFlinger, data, reply); |
1321 | - struct audio_port port; | |
1322 | - data.read(&port, sizeof(struct audio_port)); | |
1327 | + struct audio_port port = {}; | |
1328 | + if (data.read(&port, sizeof(struct audio_port)) != NO_ERROR) { | |
1329 | + ALOGE("b/23905951"); | |
1330 | + } | |
1323 | 1331 | status_t status = getAudioPort(&port); |
1324 | 1332 | reply->writeInt32(status); |
1325 | 1333 | if (status == NO_ERROR) { |
@@ -1331,8 +1339,10 @@ status_t BnAudioFlinger::onTransact( | ||
1331 | 1339 | CHECK_INTERFACE(IAudioFlinger, data, reply); |
1332 | 1340 | struct audio_patch patch; |
1333 | 1341 | data.read(&patch, sizeof(struct audio_patch)); |
1334 | - audio_patch_handle_t handle; | |
1335 | - data.read(&handle, sizeof(audio_patch_handle_t)); | |
1342 | + audio_patch_handle_t handle = {}; | |
1343 | + if (data.read(&handle, sizeof(audio_patch_handle_t)) != NO_ERROR) { | |
1344 | + ALOGE("b/23905951"); | |
1345 | + } | |
1336 | 1346 | status_t status = createAudioPatch(&patch, &handle); |
1337 | 1347 | reply->writeInt32(status); |
1338 | 1348 | if (status == NO_ERROR) { |
@@ -1085,8 +1085,10 @@ status_t BnAudioPolicyService::onTransact( | ||
1085 | 1085 | |
1086 | 1086 | case GET_AUDIO_PORT: { |
1087 | 1087 | CHECK_INTERFACE(IAudioPolicyService, data, reply); |
1088 | - struct audio_port port; | |
1089 | - data.read(&port, sizeof(struct audio_port)); | |
1088 | + struct audio_port port = {}; | |
1089 | + if (data.read(&port, sizeof(struct audio_port)) != NO_ERROR) { | |
1090 | + ALOGE("b/23912202"); | |
1091 | + } | |
1090 | 1092 | status_t status = getAudioPort(&port); |
1091 | 1093 | reply->writeInt32(status); |
1092 | 1094 | if (status == NO_ERROR) { |
@@ -1099,8 +1101,10 @@ status_t BnAudioPolicyService::onTransact( | ||
1099 | 1101 | CHECK_INTERFACE(IAudioPolicyService, data, reply); |
1100 | 1102 | struct audio_patch patch; |
1101 | 1103 | data.read(&patch, sizeof(struct audio_patch)); |
1102 | - audio_patch_handle_t handle; | |
1103 | - data.read(&handle, sizeof(audio_patch_handle_t)); | |
1104 | + audio_patch_handle_t handle = {}; | |
1105 | + if (data.read(&handle, sizeof(audio_patch_handle_t)) != NO_ERROR) { | |
1106 | + ALOGE("b/23912202"); | |
1107 | + } | |
1104 | 1108 | status_t status = createAudioPatch(&patch, &handle); |
1105 | 1109 | reply->writeInt32(status); |
1106 | 1110 | if (status == NO_ERROR) { |