summaryrefslogtreecommitdiffstats
path: root/drm/libdrmframework
diff options
context:
space:
mode:
authorHenrik B Andersson <henrikb.andersson@sonymobile.com>2012-10-26 15:15:15 +0200
committerJames Dong <jdong@google.com>2013-01-24 12:49:26 -0800
commitb7a56193d5723cfb9984ae3a4feecb2212690a65 (patch)
tree2f7b61d17c19f921a2e9d467fb1e46500d126fa5 /drm/libdrmframework
parent7acd13defdb3f33b2e266f1ef8f3ac85285c5e27 (diff)
downloadframeworks_av-b7a56193d5723cfb9984ae3a4feecb2212690a65.zip
frameworks_av-b7a56193d5723cfb9984ae3a4feecb2212690a65.tar.gz
frameworks_av-b7a56193d5723cfb9984ae3a4feecb2212690a65.tar.bz2
Fix for not ending up in an eternal loop in DrmManager.
In the original code a random number is used to get try to find an empty slot in the list of free DRM id's. When you reached the limit of 0xfff id's you ended up in an eternal loop causing ANRs. Updated by James Dong <jdong@google.com>. Change-Id: I70176cc3f770223c4a8060f9739fe2bc03a703d9
Diffstat (limited to 'drm/libdrmframework')
-rw-r--r--drm/libdrmframework/include/DrmManager.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/drm/libdrmframework/include/DrmManager.h b/drm/libdrmframework/include/DrmManager.h
index 491e8f7..8ab693f 100644
--- a/drm/libdrmframework/include/DrmManager.h
+++ b/drm/libdrmframework/include/DrmManager.h
@@ -144,7 +144,11 @@ private:
bool canHandle(int uniqueId, const String8& path);
private:
- Vector<int> mUniqueIdVector;
+ enum {
+ kMaxNumUniqueIds = 0x1000,
+ };
+
+ bool mUniqueIdArray[kMaxNumUniqueIds];
static const String8 EMPTY_STRING;
int mDecryptSessionId;