From a1d401d9f4a6ba477f0e07204e0b9481befcc928 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Wed, 20 Nov 2013 14:37:13 -0800 Subject: Check all server-provided sp If the sp 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 --- media/libmedia/IAudioTrack.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'media/libmedia/IAudioTrack.cpp') 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(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(reply.readStrongBinder()); + if (*buffer != 0 && (*buffer)->pointer() == NULL) { + (*buffer).clear(); + } } } return status; -- cgit v1.1