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
commit13f7fe763b9ad52fc27f21ed923c46b9555a321f (patch)
tree5bcd3cda2da2ab8a1e2f191113fe01c2f5f63664 /drm/libdrmframework
parent2a330d6cbb25f0cdd6208aeee53b4a3b88dae3b0 (diff)
downloadframeworks_av-13f7fe763b9ad52fc27f21ed923c46b9555a321f.zip
frameworks_av-13f7fe763b9ad52fc27f21ed923c46b9555a321f.tar.gz
frameworks_av-13f7fe763b9ad52fc27f21ed923c46b9555a321f.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;