diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/LV2URIMap.cpp | 4 | ||||
-rw-r--r-- | src/shared/LV2URIMap.hpp | 5 |
2 files changed, 9 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)); diff --git a/src/shared/LV2URIMap.hpp b/src/shared/LV2URIMap.hpp index 894df25f..a4bdb2d8 100644 --- a/src/shared/LV2URIMap.hpp +++ b/src/shared/LV2URIMap.hpp @@ -18,10 +18,15 @@ #ifndef INGEN_SHARED_LV2URIMAP_HPP #define INGEN_SHARED_LV2URIMAP_HPP +#include <map> + #include <boost/utility.hpp> + #include "raul/URI.hpp" + #include "lv2/lv2plug.in/ns/ext/uri-map/uri-map.h" #include "lv2/lv2plug.in/ns/ext/uri-unmap/uri-unmap.h" + #include "ingen-config.h" #include "LV2Features.hpp" |