-
Notifications
You must be signed in to change notification settings - Fork 630
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
Address OSS Fuzz Issues #1268
Merged
cary-ilm
merged 5 commits into
AcademySoftwareFoundation:main
from
kdt3rd:fix_ossfuzz_10_Jul_2022
Jul 31, 2022
+116
−70
Merged
Address OSS Fuzz Issues #1268
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a96e307
Add utility function header
kdt3rd 76ff46d
Fix issues with odd y_sampling numbers
kdt3rd 5b078c6
Fix integer overflow computing deep chunk index
kdt3rd f2c6835
Fix decompression scratch buffer size
kdt3rd 0ebac2a
Use appropriate buffer size when decompressing
kdt3rd 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
** SPDX-License-Identifier: BSD-3-Clause | ||
** Copyright Contributors to the OpenEXR Project. | ||
*/ | ||
|
||
#include <stdint.h> | ||
|
||
static inline int | ||
compute_sampled_lines (int height, int y_sampling, int start_y) | ||
{ | ||
int nlines; | ||
|
||
if (y_sampling <= 1) return height; | ||
|
||
if (height == 1) | ||
nlines = (start_y % y_sampling) == 0 ? 1 : 0; | ||
else | ||
{ | ||
int start, end; | ||
|
||
/* computed the number of times y % ysampling == 0, by | ||
* computing interval based on first and last time that occurs | ||
* on the given range | ||
*/ | ||
start = start_y % y_sampling; | ||
if (start != 0) | ||
start = start_y + (y_sampling - start); | ||
else | ||
start = start_y; | ||
end = start_y + height - 1; | ||
end -= (end % y_sampling); | ||
|
||
if (start > end) | ||
nlines = 0; | ||
else | ||
nlines = (end - start) / y_sampling + 1; | ||
} | ||
|
||
return nlines; | ||
} |
This file contains 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
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 assume the INT32_MAX (as opposed to another constant) is consistent with the rest of the implementation of the core?