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

Valid unknown application extensions are parsed incorrectly #47

Open
follower opened this issue Mar 26, 2018 · 0 comments
Open

Valid unknown application extensions are parsed incorrectly #47

follower opened this issue Mar 26, 2018 · 0 comments

Comments

@follower
Copy link

AFAICT this is not a valid way to skip unknown application extensions:

x-gif/src/exploder.js

Lines 64 to 65 in 085b0c7

streamReader.log("A weird application extension. Skip until we have 2 NULL bytes");
while (!(streamReader.readByte() === 0 && streamReader.peekByte() === 0));

This is because:

  1. Sub-block data of the extension could contain two consecutive zeros.
  2. AFAICT there's no requirement for application extensions to end with 0x00 0x00 (See: http://www.matthewflickinger.com/lab/whatsinagif/bits_and_bytes.asp#plain_text_extension_block. While the NETSCAPE2.0 extension happens to end with 0x00 0x00 only the final 0x00 is considered the block terminator. ). I think the correct approach is to read sub-block sizes and skip each sub-block until the size is 0 (as is done elsewhere).
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

1 participant