fix rub to crash gracefully upon decoding invalid data

if we exceed the number of available bits, crash.