From a2483a839264369482fff135d33f007ded266d3c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 4 Aug 2021 11:37:39 +0200 Subject: Fix crash when loading a kit with more channels than the engine was compiled for. --- src/events_ds.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/events_ds.h') diff --git a/src/events_ds.h b/src/events_ds.h index fdab881..41287d1 100644 --- a/src/events_ds.h +++ b/src/events_ds.h @@ -149,6 +149,8 @@ private: template T& EventsDS::emplace(channel_t ch, Args&&... args) { + assert(ch < NUM_CHANNELS); + // add new event types here static_assert(std::is_same::value, "Check event type"); @@ -180,6 +182,8 @@ T& EventsDS::get(EventID event_id) template ContainerRange> EventsDS::iterateOver(channel_t ch) { + assert(ch < NUM_CHANNELS); + // add new event types here static_assert(std::is_same::value, "Check event type"); @@ -193,6 +197,8 @@ ContainerRange> EventsDS::iterateOver(channel_t ch) template T& EventsDS::getSample(EventInfo const& info) { + assert(info.ch < NUM_CHANNELS); + // add new event types here static_assert(std::is_same::value, "Check event type"); -- cgit v1.2.3