summaryrefslogtreecommitdiffstats
path: root/media/libmedia/IAudioPolicyService.cpp
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2015-09-02 16:46:59 -0700
committerThe Android Automerger <android-build@google.com>2015-09-28 17:08:17 -0700
commit0ddd3f4a20e13914b5a4253d38b6887557f2ca1d (patch)
tree9cae85a5ab5e1f2b2ace37f95c7f110e768984fe /media/libmedia/IAudioPolicyService.cpp
parent229338ad56771edf3a65355f97e872d0cbe9230f (diff)
downloadframeworks_av-0ddd3f4a20e13914b5a4253d38b6887557f2ca1d.zip
frameworks_av-0ddd3f4a20e13914b5a4253d38b6887557f2ca1d.tar.gz
frameworks_av-0ddd3f4a20e13914b5a4253d38b6887557f2ca1d.tar.bz2
Zero out return values in media binder calls
More specifically when handling: * GET_STREAM_VOLUME in IAudioPolicyService, and * GET_CURRENT_POSITION and GET_DURATION in IMediaPlayer This prevents leaking uninitialized values across binder in error cases. Bug: 23756261 Change-Id: I0ffd900ab12b685b0611259ade4a3efb1ec5defe
Diffstat (limited to 'media/libmedia/IAudioPolicyService.cpp')
-rw-r--r--media/libmedia/IAudioPolicyService.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libmedia/IAudioPolicyService.cpp b/media/libmedia/IAudioPolicyService.cpp
index 3348441..baa5c7d 100644
--- a/media/libmedia/IAudioPolicyService.cpp
+++ b/media/libmedia/IAudioPolicyService.cpp
@@ -994,7 +994,7 @@ status_t BnAudioPolicyService::onTransact(
audio_stream_type_t stream =
static_cast <audio_stream_type_t>(data.readInt32());
audio_devices_t device = static_cast <audio_devices_t>(data.readInt32());
- int index;
+ int index = 0;
status_t status = getStreamVolumeIndex(stream, &index, device);
reply->writeInt32(index);
reply->writeInt32(static_cast <uint32_t>(status));