-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
Jpeg HuffmanTable improvements #1926
Jpeg HuffmanTable improvements #1926
Conversation
Gotcha
One of the invalid test images was going out of bounds during new |
Ah nice, well done finding that. So now I guess we have to find a way to sanitise cheaply and then try to move the table building to the constructor. |
It's actually a bug, there's a possibility for malformed image go out of bounds without any exceptions in current master. I found a way to check that without a noticable slowdown. I'd also create an example image for a test suite. |
Codecov Report
@@ Coverage Diff @@
## master #1926 +/- ##
======================================
- Coverage 88% 88% -1%
======================================
Files 966 966
Lines 51350 51320 -30
Branches 6401 6397 -4
======================================
- Hits 45218 45188 -30
Misses 5074 5074
Partials 1058 1058
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
High hopes it would pass all the tests, it is ready to be reviewed:
There's no need for a new test image, image from #839 has malformed DHT marker which goes out-of-bounds during huffman table for unsafe pointers (which is unspottable without wrapping them with this is my favourite
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Faster... Fantastic 🤣
This is very, very good as always. Thanks! 👍
Prerequisites
Description
This PR removes redundant
Configure()
calls forHuffmanTable
and removes stack pressure fromstackalloc
calls.TODO
Configure()
methodstackalloc
calls