summaryrefslogtreecommitdiffstats
path: root/media/libmedia/IMediaPlayer.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/IMediaPlayer.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/IMediaPlayer.cpp')
-rw-r--r--media/libmedia/IMediaPlayer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp
index 7387a79..942aec3 100644
--- a/media/libmedia/IMediaPlayer.cpp
+++ b/media/libmedia/IMediaPlayer.cpp
@@ -566,7 +566,7 @@ status_t BnMediaPlayer::onTransact(
} break;
case GET_CURRENT_POSITION: {
CHECK_INTERFACE(IMediaPlayer, data, reply);
- int msec;
+ int msec = 0;
status_t ret = getCurrentPosition(&msec);
reply->writeInt32(msec);
reply->writeInt32(ret);
@@ -574,7 +574,7 @@ status_t BnMediaPlayer::onTransact(
} break;
case GET_DURATION: {
CHECK_INTERFACE(IMediaPlayer, data, reply);
- int msec;
+ int msec = 0;
status_t ret = getDuration(&msec);
reply->writeInt32(msec);
reply->writeInt32(ret);