-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Support EOF in the middle of JPEG #240
Conversation
Hey! Thanks a lot for the PR There seems to be an issue with your changes that makes the CI fail to run with the jpeg test file we're using. Could you check what happened there? |
I'm not sure, but I think there is a bug in I am using this image for tests and
And I got this result, and it's correct: But when I change It's hard for me to confirm this, but can I kindly ask you to check this bug? |
It wasn't that hard to verify the error. After getting -1 when the last byte of the file was included in the search I resized the input file by adding an extra byte at the end and then the search including 0xD9 was correct again. It looks like the unit test fails because it uses the result of the find sequence function to calculate an array size. Because of the bug you found, the find sequence function is returning -1 which is not a valid array size. Although all jpegs must include this sequence it is a good idea to check the result of the find sequence function for failure to find it (eg file was corrupted) so you can print a better error message (like "missing eof sequence" or something) instead of the "-1 is not a valid array size" that it prints currently. |
Ready to check |
Ping |
Thank you! |
Before
After
JPEG to reproduce
More information in #239