bf_read::ReadSignedVarInt64 Incorrect intermediate type

Author: SizzlingCalamariCreated May 16, 2015Updated Aug 10, 2026

https://github.com/ValveSoftware/source-sdk-2013/blob/master/src/tier1/bitbuf.cpp#L1067

In bf_read::ReadSignedVarInt64, the encoded value is read into a uint32, which should be a uint64. This looks like a copy paste bug.

Current:

int64 bf_read::ReadSignedVarInt64()
{
    uint32 value = ReadVarInt64();
    return bitbuf::ZigZagDecode64( value );
}

Fixed:

int64 bf_read::ReadSignedVarInt64()
{
    uint64 value = ReadVarInt64();
    return bitbuf::ZigZagDecode64( value );
}

Source: ValveSoftware/source-sdk-2013