Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra bits on the sequence stream are ignored #1597

Closed
klauspost opened this issue Apr 23, 2019 · 2 comments
Closed

Extra bits on the sequence stream are ignored #1597

klauspost opened this issue Apr 23, 2019 · 2 comments

Comments

@klauspost
Copy link

It seems that any leftover bits on the sequence stream are ignored.

While it is debatable what it should do, it should either:

  1. Cause an error or
  2. Be specified in the spec

Here are a couple of samples with extra bits in the sequences:

extrabits.zip

@Cyan4973
Copy link
Contributor

That's a good point @klauspost ,
the decoder must consume exactly all bits, and not more.
If some bits remain, it should be considered an error.
Something to clarify, and enforce.

@terrelln
Copy link
Contributor

The patch now errors when it detects the bitstream isn't complete. This flags the error on all the inputs in extrabits except 0ef619d15539778c4ba2ec7fc51d526226a5b816. That input "overflows" the bitstream and returns BIT_DStream_overflow. The overflowed data is ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants