On Wed Nov 2 16:15:31 2022 +0000, Giovanni Mascellani wrote:
We should probably check when `shift` becomes 64 or larger and produce an error if it does. We shouldn't invoke undefined behavior even on invalid input streams.
Even with v3 technically we can end up accepting a stream in which some set bit falls outside of the first 64. For example, in a VBR6 (in which, then, each individual limb has 5 bits), you can have the last limb with the highest bit set, which would then be bit 65. The current code wouldn't detect that (because the last limb would still have its continuation bit cleared). I don't know if that bitstream should be considered well formed or not.
At any rate, we probably don't really need to be water tight about that. I am mentioning this just because I noticed it. I think the current code is fine.