diff options
author | Glenn Kasten <gkasten@google.com> | 2013-11-20 14:37:13 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-11-20 14:51:13 -0800 |
commit | a1d401d9f4a6ba477f0e07204e0b9481befcc928 (patch) | |
tree | e69861e0db24437dfe302e29e84980a8ea3e9f4e /media/libmedia/IAudioTrack.cpp | |
parent | e75da4004b2c814987aa2adf8a76190f92d99c65 (diff) | |
download | frameworks_av-a1d401d9f4a6ba477f0e07204e0b9481befcc928.zip frameworks_av-a1d401d9f4a6ba477f0e07204e0b9481befcc928.tar.gz frameworks_av-a1d401d9f4a6ba477f0e07204e0b9481befcc928.tar.bz2 |
Check all server-provided sp<IMemory>
If the sp<IMemory> from server is non-0, make sure it also has
a non-NULL pointer(). If it is NULL, treat it as if the sp<> was 0.
Change-Id: I6d0bd786587eb73fac38af787c11eba541880685
Diffstat (limited to 'media/libmedia/IAudioTrack.cpp')
-rw-r--r-- | media/libmedia/IAudioTrack.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/media/libmedia/IAudioTrack.cpp b/media/libmedia/IAudioTrack.cpp index 3cd9cfd..ffc21fc 100644 --- a/media/libmedia/IAudioTrack.cpp +++ b/media/libmedia/IAudioTrack.cpp @@ -60,6 +60,9 @@ public: status_t status = remote()->transact(GET_CBLK, data, &reply); if (status == NO_ERROR) { cblk = interface_cast<IMemory>(reply.readStrongBinder()); + if (cblk != 0 && cblk->pointer() == NULL) { + cblk.clear(); + } } return cblk; } @@ -122,6 +125,9 @@ public: status = reply.readInt32(); if (status == NO_ERROR) { *buffer = interface_cast<IMemory>(reply.readStrongBinder()); + if (*buffer != 0 && (*buffer)->pointer() == NULL) { + (*buffer).clear(); + } } } return status; |