summaryrefslogtreecommitdiffstats
path: root/src/shared/LV2URIMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/LV2URIMap.cpp')
-rw-r--r--src/shared/LV2URIMap.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/LV2URIMap.cpp b/src/shared/LV2URIMap.cpp
index 24bc1611..90582102 100644
--- a/src/shared/LV2URIMap.cpp
+++ b/src/shared/LV2URIMap.cpp
@@ -138,6 +138,10 @@ LV2URIMap::uri_to_id(const char* map,
if (i != _global_to_event.end()) {
return i->second;
} else {
+ if (_global_to_event.size() + 1 > UINT16_MAX) {
+ error << "Event URI " << uri << " ID out of range." << endl;
+ return NULL;
+ }
const uint16_t ev_id = _global_to_event.size() + 1;
assert(_event_to_global.find(ev_id) == _event_to_global.end());
_global_to_event.insert(make_pair(id, ev_id));