forked from AcademySoftwareFoundation/OpenImageIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Detect invalid ICC profile tags (AcademySoftwareFoundation#4557)
Affects jpeg, tiff, and other formats with embedded ICC profiles. Corrupted/invalid tag offset and/or length values were causing us to touch memory outside the memory allocated for the profile. Fixes AcademySoftwareFoundation#4551 Not sure if this is wise or not, but for JPEGs, I also enabled some previously commented-out code that has the effect of treating a file with a verifiably corrupted/nonsensical ICC profile block as a failed file. If people ever complain about this in the future, maybe we'll come back and add some kind of global option that lets the app express how tolerant OIIO readers should be about corruptions in files -- do you assume that the whole file is bogus or malicious upon discovering the first invalidity, or do you press on and hope you can get something else useful from the pixels? Let's be cautious for now. --------- Signed-off-by: Larry Gritz <lg@larrygritz.com>
- Loading branch information
Showing
8 changed files
with
48 additions
and
7 deletions.
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
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,21 @@ | ||
Reading src/corrupt-exif.jpg | ||
src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg | ||
SHA-1: 3EA7BAEB0871E9B9BAADF286521423199ACA2401 | ||
channel list: R, G, B | ||
Orientation: 1 (normal) | ||
ResolutionUnit: "in" | ||
XResolution: 300 | ||
YResolution: 300 | ||
jpeg:subsampling: "4:2:0" | ||
oiio:ColorSpace: "sRGB" | ||
Reading src/corrupt-exif-1626.jpg | ||
src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg | ||
SHA-1: 6CBB7DB602A67DB300AB28842F20F6DCA02B82B1 | ||
channel list: R, G, B | ||
Orientation: 1 (normal) | ||
ResolutionUnit: "in" | ||
XResolution: 300 | ||
YResolution: 300 | ||
jpeg:subsampling: "4:2:0" | ||
oiio:ColorSpace: "sRGB" | ||
corrupt-icc-4551.jpg |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.