diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp index 8bd0163..e254cd3 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -184,7 +184,7 @@ namespace fc { s.get(b); v |= uint32_t(uint8_t(b) & 0x7f) << by; by += 7; - } while( uint8_t(b) & 0x80 ); + } while( (uint8_t(b) & 0x80) && by < 32 ); vi.value = ((v>>1) ^ (v>>31)) + (v&0x01); vi.value = v&0x01 ? vi.value : -vi.value; vi.value = -vi.value; @@ -195,7 +195,7 @@ namespace fc { s.get(b); v |= uint64_t(uint8_t(b) & 0x7f) << by; by += 7; - } while( uint8_t(b) & 0x80 ); + } while( (uint8_t(b) & 0x80) && by < 64 ); vi.value = static_cast(v); }