deps/unrar/rawread.cpp
// Read vint from arbitrary byte array.
Read vint from arbitrary byte array.
Read vint from arbitrary byte array .
uint64 RawGetV(const byte *Data,uint &ReadPos,uint DataSize,bool &Overflow)
{
  Overflow=false;
  uint64 Result=0;
  for (uint Shift=0;ReadPos<DataSize;Shift+=7)
  {
    byte CurByte=Data[ReadPos++];
    Result+=uint64(CurByte & 0x7f)<<Shift;
    if ((CurByte & 0x80)==0)
      return Result; 
  }
  Overflow=true;
  return 0; 
}
uint64 RawGetV ( const byte * Data , uint & ReadPos , uint DataSize , bool & Overflow ) { Overflow = false ; uint64 Result = 0 ; for ( uint Shift = 0 ; ReadPos < DataSize ; Shift += 7 ) { byte CurByte = Data [ ReadPos ++ ] ; Result += uint64 ( CurByte & 0x7f ) << Shift ; if ( ( CurByte & 0x80 ) == 0 ) return Result ; } Overflow = true ; return 0 ; }
Read vint from arbitrary byte array.
Read vint from arbitrary byte array .
// Decoded successfully. // Out of buffer border.