summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-09-16 17:36:55 -0700
committerDan Albert <danalbert@google.com>2014-09-16 17:36:55 -0700
commit12604519328867f11511b967565607971234c0ab (patch)
treebc2eb096fa3229d8be7b3ea902588ed299a09b27
parent14fc930d5d2ef272b39342fa083f4097464fc9ea (diff)
downloadframeworks_av-12604519328867f11511b967565607971234c0ab.zip
frameworks_av-12604519328867f11511b967565607971234c0ab.tar.gz
frameworks_av-12604519328867f11511b967565607971234c0ab.tar.bz2
Check for NULL before calling asBinder().
The old asBinder() checked if this == NULL, which is undefined behavior. Change-Id: Ibde628395ca10dfef0d2f59e81280576f104b83c
-rw-r--r--drm/common/IDrmManagerService.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/drm/common/IDrmManagerService.cpp b/drm/common/IDrmManagerService.cpp
index db41e0b..36cb612 100644
--- a/drm/common/IDrmManagerService.cpp
+++ b/drm/common/IDrmManagerService.cpp
@@ -148,7 +148,8 @@ status_t BpDrmManagerService::setDrmServiceListener(
data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor());
data.writeInt32(uniqueId);
- data.writeStrongBinder(drmServiceListener->asBinder());
+ data.writeStrongBinder(
+ drmServiceListener != NULL ? drmServiceListener->asBinder() : NULL);
remote()->transact(SET_DRM_SERVICE_LISTENER, data, &reply);
return reply.readInt32();
}