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

PNG inflate is sometimes missing last byte #414

Closed
kmcallister opened this issue May 13, 2015 · 4 comments
Closed

PNG inflate is sometimes missing last byte #414

kmcallister opened this issue May 13, 2015 · 4 comments

Comments

@kmcallister
Copy link

In some cases inflate.rs skips the last byte of the decompressed stream, e.g.:

input   02 ec 30 00
flate2  c3
piston

input   02 c8 00 30 00
flate2  30
piston

input   f2 84 00 80 00 0b 00 30
flate2  49 49 49 49 49 49 49 50
piston  49 49 49 49 49 49 49

input   da 30 7f f1 5d 80 00 ab 00 30
flate2  b0 9f a3 dd 78
piston  b0 9f a3 dd

input   da ff 80 30 30 82 00 80 00 cb 00 30
flate2  bf e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0
        e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0
        e0 e0 e0 e0 32 32 32 32 32 32 32 68
piston  bf e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0
        e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0
        e0 e0 e0 e0 32 32 32 32 32 32 32

input   f2 00 01 80 00 13 00 30
flate2  48 48 48 48 48 10
piston  48 48 48 48 48

(I found these examples using afl.rs.)

I found some other discrepancies in the inflate implementation that I haven't categorized yet. I might hold off on that, if @nwin's new PNG decoder using libflate2 will be ready soon.

@nwin
Copy link
Contributor

nwin commented May 16, 2015

Interesting finding, it’s probably just something off by one… The new PNG decoder should be ready soon. I just need to implement some edge cases and support for 16 bit (which we don’t have right now anyway).

@kmcallister
Copy link
Author

Sounds great! There are some 16-bit images in Servo's test suite.

@nwin
Copy link
Contributor

nwin commented May 26, 2015

It’s now passing the whole png testsuite. I need to integrate it into image and we should be ready to roll at least on the png side…

@nwin
Copy link
Contributor

nwin commented Jun 8, 2015

Closed via #418.

@nwin nwin closed this as completed Jun 8, 2015
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

2 participants