map operator usage problem
In function rpc_open_cdm_mediakeysession_release_1_svc() or rpc_open_cdm_mediakeysession_update_1_svc()
p_mediaKeySession = g_mediaKeySessions[params->session_id.session_id_val];
if (p_mediaKeySession) {
It seems not safty. If params->session_id.session_id_val matches the key of an element in the map, it will return a reference to its mapped value, and it's ok. But, if it does not match the key of any element in the map, it will inserts a new element with that key and returns a reference to its mapped value.
It left some trash element in this map.
reference from http://www.cplusplus.com/reference/map/map/operator[]/
I found another bug at rpc_open_cdm_mediakeysession_release_1_svc function g_mediaKeySessions.erase(params->session_id.session_id_val ) did not remove the whole entry from map it left some barbage in map and cause cdmi service crash, you should use iterator item to remove the entry