diff --git a/include/bitstream/BitReader.h b/include/bitstream/BitReader.h index 159af1c55..0c82bd83e 100644 --- a/include/bitstream/BitReader.h +++ b/include/bitstream/BitReader.h @@ -39,7 +39,8 @@ class BitReader inline DWORD Get(DWORD n) { - assert(n <= 32); + if (n > 32) + throw std::invalid_argument("BitReader::Get() n > 32"); //Debug(">BitReader::Get() n:%d cached:%d\n", n, cached); //BitDump(cache, cached); @@ -105,7 +106,8 @@ class BitReader inline DWORD Peek(DWORD n) { - assert(n <= 32); + if (n > 32) + throw std::invalid_argument("BitReader::Peek() n > 32"); DWORD ret = 0;