Skip to content

Commit dbd9da9

Browse files
dmxpp: fix some dmx models not being parsed correctly
1 parent a267e42 commit dbd9da9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/dmxpp/dmxpp.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,16 @@ bool DMX::openBinary(BufferStream& stream) {
121121
}
122122

123123
// Read a string index and get the string from the list
124-
const auto readStringFromIndex = [stringListIndicesAreShort, &stringList](BufferStream& stream_) {
124+
const auto readStringFromIndex = [stringListIndicesAreShort, &stringList](BufferStream& stream_) -> std::string {
125125
uint32_t index;
126126
if (stringListIndicesAreShort) {
127127
index = stream_.read<uint16_t>();
128128
} else {
129129
index = stream_.read<uint32_t>();
130130
}
131131
if (index >= stringList.size()) {
132-
throw std::overflow_error{"String list index out of bounds!"};
132+
// This is an intentional feature of the format
133+
return "";
133134
}
134135
return stringList.at(index);
135136
};

0 commit comments

Comments
 (0)