diff --git a/src/streams.h b/src/streams.h index e5a18c56b74..be6b7452a86 100644 --- a/src/streams.h +++ b/src/streams.h @@ -117,6 +117,9 @@ public: void ignore(size_t n) { + if (n > m_data.size()) { + throw std::ios_base::failure("SpanReader::ignore(): end of data"); + } m_data = m_data.subspan(n); } };