-
-
Notifications
You must be signed in to change notification settings - Fork 887
Add missing decoder sanitation checks #2077
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d3936e2
Add check for App1 XMP marker length
JimBobSquarePants 96f6fd4
Add check, if enough data is read in LoadTables
brianpopow 588a6d4
Fix lossy image with not enough exif bytes
brianpopow f820b0b
ParseOptional chunks now checks, if enough data is read
brianpopow 853b222
Add test for lossy with exif which does not contain enough data
brianpopow 5d04734
Add checks in ReadVp8Header() to make sure enough data is read
brianpopow 8cc5a6b
Remove code duplication when reading the profile data
brianpopow 8e4129a
Make sure enough data is read in ReadVp8XHeader()
brianpopow aac680f
Add check, if enough data was read for progressive scan decoding data
brianpopow e6ad467
Add check in ReadUint16 for enough data
brianpopow d22e50c
Ignore invalid EXIF or XMP chunks
brianpopow ced9887
Add checks, if enough data was read
brianpopow 4a32c75
Merge branch 'main' into js/decode-sanitation
JimBobSquarePants c5f14f7
Merge branch 'main' into js/decode-sanitation
JimBobSquarePants 2ac18d8
Optimize tiff/jpeg checks
JimBobSquarePants 911d8d7
Merge branch 'main' into js/decode-sanitation
JimBobSquarePants File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we can remove this and similar checks from other marker parsing methods as it's now guaranteed that stream has at least
remainingbytes available.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.
Ah... That method is actually called from TIFF only.
Uh oh!
There was an error while loading. Please reload this page.
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.
But we still can transform 2 read checks to 1
AvailableBytescheck :)I can't comment on non diff lines but that method creates stream:
and then do 2 reads of 2 bytes with sequential if checks.
We can do this check:
before even creating a stream and remove 2 checks after reads as those would always be true.
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.
Cool. Will have a look.