diff --git a/src/streams.h b/src/streams.h index fdba4622f..9b678b3c0 100644 --- a/src/streams.h +++ b/src/streams.h @@ -241,7 +241,9 @@ public: CBaseDataStream& ignore(int nSize) { // Ignore from the beginning of the buffer - assert(nSize >= 0); + if (nSize < 0) { + throw std::ios_base::failure("CDataStream::ignore(): nSize negative"); + } unsigned int nReadPosNext = nReadPos + nSize; if (nReadPosNext >= vch.size()) {