-
Notifications
You must be signed in to change notification settings - Fork 616
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
Various checks to improve handling of damaged input files #643
Various checks to improve handling of damaged input files #643
Conversation
peterhillman
commented
Jan 23, 2020
- Prevent out-of-bounds reads by better sanity checking of input data
- Fix memory leaks when exceptions are thrown from constructors when opening broken files
- Fix memory leaks in test suite
…mum dimensions of data windows Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
…ne error on max suffix string length Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
…ubles to prevent rounding causing overflows Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
…table wasn't deleted Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
@@ -288,6 +288,7 @@ DeepTiledInputFile::Data::Data (int numThreads): | |||
multiPartBackwardSupport(false), | |||
numThreads(numThreads), | |||
memoryMapped(false), | |||
sampleCountTableComp(NULL), |
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.
NULLs are expected to be nullptr these days....
OpenEXR/IlmImf/ImfHuf.cpp
Outdated
@@ -1052,7 +1052,10 @@ hufUncompress (const char compressed[], | |||
unsigned short raw[], | |||
int nRaw) | |||
{ | |||
if (nCompressed == 0) | |||
// | |||
// nead at least 20 bytes for header |
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.
typo "need"
OpenEXR/IlmImf/ImfTiledInputFile.cpp
Outdated
@@ -745,7 +745,10 @@ TiledInputFile::TiledInputFile (const char fileName[], int numThreads): | |||
|
|||
delete _data->_streamData; | |||
} | |||
|
|||
if (_data) |
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.
these null checks aren't necessary, and there's a few in a row that check != 0 or the pointer. Be better to just squash them all to delete....
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.
Everything checks out, there's a few super minor things, noted in local comments.
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
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.
Thanks for the changes!
* fix leak when maximum number of tiles is exceeded * fix leak in InputPart constructor logic Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>