Skip to content

Commit

Permalink
Merge branch 'master' into pr.includes
Browse files Browse the repository at this point in the history
  • Loading branch information
cary-ilm authored Feb 20, 2020
2 parents 0a10abe + a0e84f6 commit 6ba11ef
Show file tree
Hide file tree
Showing 15 changed files with 328 additions and 94 deletions.
66 changes: 64 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# OpenEXR Release Notes

* [Version 2.4.0](#version-240-tbd)
* [Version 2.4.1](#version-241-february-11-2020)
* [Version 2.4.0](#version-240-september-19-2019)
* [Version 2.3.0](#version-230-august-13-2018)
* [Version 2.2.1](#version-221-november-30-2017)
* [Version 2.2.0](#version-220-august-10-2014)
Expand Down Expand Up @@ -30,7 +31,68 @@
* [Version 1.0.1](#version-101)
* [Version 1.0](#version-10)

## Version 2.4.0
## Version 2.4.1 (February 11, 2020)

Patch release with minor bug fixes.

### Summary

* Various fixes for memory leaks and invalid memory accesses
* Various fixes for integer overflow with large images.
* Various cmake fixes for build/install of python modules.
* ImfMisc.h is no longer installed, since it's a private header.

### Merged Pull Requests

* [659](https://github.com/AcademySoftwareFoundation/openexr/pull/659) fix memory leaks and invalid memory accesses

* [609](https://github.com/AcademySoftwareFoundation/openexr/pull/609) Fixes #593, others - issues with pyilmbase install

* [605](https://github.com/AcademySoftwareFoundation/openexr/pull/605) No longer install ImfMisc.h

* [603](https://github.com/openexr/openexr/pull/603) Update Azure build to work with new RB-2.4 branch.

* [596](https://github.com/AcademySoftwareFoundation/openexr/pull/596) Add Boost::Python to Python modules link libraries

* [592](https://github.com/AcademySoftwareFoundation/openexr/pull/592) Take DESTDIR into account when creating library symlinks

* [589](https://github.com/openexr/openexr/pull/589) Fix int32 overflow bugs with deep images

### Commits \[ git log v2.4.0...v2.4.1\]

* [fix memory leaks and invalid memory accesses](https://github.com/AcademySoftwareFoundation/openexr/commit/e79d2296496a50826a15c667bf92bdc5a05518b4) ([Peter Hillman](@[email protected]) 2020-02-08)

* [Fix overzealous removal of if statements breaking all builds except win32](https://github.com/openexr/openexr/commit/031199cd4fc062dd7bfe902c6552cf22f6bfbbdb) ([Kimball Thurston](@[email protected]) 2019-11-07)

* [Handle python2 not being installed, but python3 being present](https://github.com/openexr/openexr/commit/8228578da6f86d17b9a2a3f8c6053f8b4ee3fb71) ([Kimball Thurston](@[email protected]) 2019-11-07)

* [Fix issue with defines not being set correctly for win32](https://github.com/openexr/openexr/commit/d10895ef0ad25dd60e68a2ab00bab7c0592f8c5b) ([Kimball Thurston](@[email protected]) 2019-11-07)

* [Re-enable Boost_NO_BOOST_CMAKE by default, document, clean up status messages](https://github.com/openexr/openexr/commit/b303f6788a434fd61e52c1bacb93a96c4c3440ea) ([Kimball Thurston](@[email protected]) 2019-11-07)

* [Set CMP0074 such that people who set Boost_ROOT won't get warnings](https://github.com/openexr/openexr/commit/8ec1440cbd999f17457be605150bc53395fbb334) ([Kimball Thurston](@[email protected]) 2019-11-07)

* [ensure paths are canonicalized by get_filename_component prior to comparing](https://github.com/openexr/openexr/commit/28d1cb256f1b46f120adb131e606b2699acc72d7) ([Kimball Thurston](@[email protected]) 2019-11-07)

* [Fix issue with drive letter under windows](https://github.com/openexr/openexr/commit/34ce16c2653d02fcef6a297a2a61112dbf693922) ([Kimball Thurston](@[email protected]) 2019-11-06)

* [Extract to function, protect against infinite loop](https://github.com/openexr/openexr/commit/650da0d63410d863c4a0aed15a6bee1b46b559cb) ([Kimball Thurston](@[email protected]) 2019-11-06)

* [Fixes #593, others - issues with pyilmbase install](https://github.com/openexr/openexr/commit/df768ec8a97adb82947fc4b92a199db9a38c044c) ([Kimball Thurston](@[email protected]) 2019-11-05)

* [Take DESTDIR into account when creating library symlinks](https://github.com/openexr/openexr/commit/ed4807b9e4dc8d94ce79d0b2ed36acc548bee57e) ([Antonio Rojas](@[email protected]) 2019-10-19)

* [No longer install ImfMisc.h](https://github.com/openexr/openexr/commit/f1b017c8029b529c5c5ed01b6ad1b10a0e48036c) ([Cary Phillips](@[email protected]) 2019-10-31)

* [add boost to python module link library](https://github.com/openexr/openexr/commit/a571bdfe42866a1f1c579114e2fcae8318172c21) ([Jens Lindgren](@[email protected]) 2019-10-22)

* [Update Azure build to work with new branch.](https://github.com/openexr/openexr/commit/4273e84f86fe27392dec53a5cef900caf6727154) ([Christina Tempelaar-Lietz](@[email protected]) 2019-10-26)

* [Fix int32 overflow bugs with deep images](https://github.com/openexr/openexr/commit/e53ebd3ef677ab983f83f927f6525efcb5dcb995) ([Larry Gritz](@[email protected]) 2019-10-17)

* [Prepare 2.4 release branch](https://github.com/openexr/openexr/commit/486ff10547d034530c5190bbef6181324b42c209) ([Larry Gritz](@[email protected]) 2019-10-24)

## Version 2.4.0 (September 19, 2019)

### Summary

Expand Down
10 changes: 9 additions & 1 deletion OpenEXR/IlmImf/ImfInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,15 @@ InputFile::InputFile (InputPartData* part) :
_data (new Data (part->numThreads))
{
_data->_deleteStream=false;
multiPartInitialize (part);
try
{
multiPartInitialize (part);
}
catch(...)
{
delete _data;
throw;
}
}


Expand Down
20 changes: 13 additions & 7 deletions OpenEXR/IlmImf/ImfScanLineInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,11 @@ ScanLineInputFile::ScanLineInputFile(InputPartData* part)
{
for (size_t i = 0; i < _data->lineBuffers.size(); i++)
{
EXRFreeAligned(_data->lineBuffers[i]->buffer);
_data->lineBuffers[i]->buffer=nullptr;
if( _data->lineBuffers[i] )
{
EXRFreeAligned(_data->lineBuffers[i]->buffer);
_data->lineBuffers[i]->buffer=nullptr;
}
}
}

Expand Down Expand Up @@ -1234,11 +1237,14 @@ ScanLineInputFile::ScanLineInputFile
{
if (!_data->memoryMapped)
{
for (size_t i = 0; i < _data->lineBuffers.size(); i++)
{
EXRFreeAligned(_data->lineBuffers[i]->buffer);
_data->lineBuffers[i]->buffer=nullptr;
}
for (size_t i = 0; i < _data->lineBuffers.size(); i++)
{
if( _data->lineBuffers[i] )
{
EXRFreeAligned(_data->lineBuffers[i]->buffer);
_data->lineBuffers[i]->buffer=nullptr;
}
}
}
}
delete _streamData;
Expand Down
63 changes: 37 additions & 26 deletions OpenEXR/IlmImf/ImfTiledMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,40 +363,51 @@ getTiledChunkOffsetTableSize(const Header& header)
//
Int64 lineOffsetSize = 0;
const TileDescription &desc = header.tileDescription();
switch (desc.mode)
try
{
case ONE_LEVEL:
case MIPMAP_LEVELS:
for (int i = 0; i < numXLevels; i++)
{
lineOffsetSize += static_cast<Int64>(numXTiles[i]) * static_cast<Int64>(numYTiles[i]);
if ( lineOffsetSize > static_cast<Int64>(std::numeric_limits<int>::max()) )
switch (desc.mode)
{
case ONE_LEVEL:
case MIPMAP_LEVELS:
for (int i = 0; i < numXLevels; i++)
{
throw IEX_NAMESPACE::LogicExc("Maximum number of tiles exceeded");
lineOffsetSize += static_cast<Int64>(numXTiles[i]) * static_cast<Int64>(numYTiles[i]);
if ( lineOffsetSize > static_cast<Int64>(std::numeric_limits<int>::max()) )
{
throw IEX_NAMESPACE::LogicExc("Maximum number of tiles exceeded");
}
}
}
break;
case RIPMAP_LEVELS:
for (int i = 0; i < numXLevels; i++)
{
for (int j = 0; j < numYLevels; j++)
break;
case RIPMAP_LEVELS:
for (int i = 0; i < numXLevels; i++)
{
lineOffsetSize += static_cast<Int64>(numXTiles[i]) * static_cast<Int64>(numYTiles[j]);
if ( lineOffsetSize > static_cast<Int64>(std::numeric_limits<int>::max()) )
{
throw IEX_NAMESPACE::LogicExc("Maximum number of tiles exceeded");
}
for (int j = 0; j < numYLevels; j++)
{
lineOffsetSize += static_cast<Int64>(numXTiles[i]) * static_cast<Int64>(numYTiles[j]);
if ( lineOffsetSize > static_cast<Int64>(std::numeric_limits<int>::max()) )
{
throw IEX_NAMESPACE::LogicExc("Maximum number of tiles exceeded");
}
}
}
}
break;
case NUM_LEVELMODES :
throw IEX_NAMESPACE::LogicExc("Bad level mode getting chunk offset table size");
break;
case NUM_LEVELMODES :
throw IEX_NAMESPACE::LogicExc("Bad level mode getting chunk offset table size");
}
delete[] numXTiles;
delete[] numYTiles;

return static_cast<int>(lineOffsetSize);

}
catch(...)
{
delete[] numXTiles;
delete[] numYTiles;

delete[] numXTiles;
delete[] numYTiles;
throw;
}

return static_cast<int>(lineOffsetSize);
}


Expand Down
54 changes: 50 additions & 4 deletions OpenEXR/IlmImfFuzzTest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,82 @@

#include <stdlib.h>
#include <iostream>
#include <set>
#include <string.h>
#include <string>

#ifdef OPENEXR_IMF_HAVE_LINUX_PROCFS
#include <unistd.h>
#include <sstream>
#endif

#define TEST(x) if (argc < 2 || !strcmp (argv[1], #x)) x();

using std::set;
using std::string;
using std::cout;
using std::endl;

#define TEST(x) if (helpMode) tests.insert(string(#x)); else if (argc < 2 || !strcmp (argv[1], #x)) x(argc==3 ? argv[2] : nullptr);

int
main (int argc, char *argv[])
{
bool helpMode = false;
if( argc==2 && (strcmp(argv[1],"--help")==0 || strcmp(argv[1],"-h")==0))
{
helpMode = true;
}
set<string> tests;


TEST (testFuzzScanLines);
TEST (testFuzzTiles);
TEST (testFuzzDeepScanLines);
TEST (testFuzzDeepTiles);



if(helpMode)
{
cout << "IlmImfFuzzTest tests how resilient the IlmImf library is with\n"
"respect to broken input files: the program first damages\n"
"OpenEXR files by partially overwriting them with random data;\n"
"then it tries to read the damaged files. If all goes well,\n"
"then the program doesn't crash.\n";
cout << "\n";
cout << "If IlmImfFuzzTest does crash, it will leave a file in the current\n"
"directory, or /var/tmp. Running 'IlmImfFuzzTest test file' will\n"
"usually quickly reproduce the issue by attempting to reload the file,\n"
"(without running the normal tests) and is useful for debugging\n"
"the exact cause of the crash or confirming a bug is fixed.\n";
cout << "\n";
cout << "usage:\n";
cout << " IlmImfFuzzTest : with no arguments, run all tests\n";
cout << " IlmImfFuzzTest TEST : run specific TEST only\n";
cout << " IlmImfFuzzTest TEST file : try to read 'file' with given TEST\n";
cout << "\n";
cout << "TEST can be one of the following:\n";
for ( auto i = tests.begin() ; i!= tests.end() ; ++i )
{
cout << ' ' << *i << endl;
}

}
else
{

#ifdef OPENEXR_IMF_HAVE_LINUX_PROCFS

//
// Allow the user to check for file descriptor leaks
//

std::cout << "open file descriptors:" << std::endl;
cout << "open file descriptors:" << endl;

std::stringstream ss;
ss << "ls -lG /proc/" << getpid() << "/fd";

system (ss.str().c_str());
#endif

}
return 0;
}
24 changes: 16 additions & 8 deletions OpenEXR/IlmImfFuzzTest/testFuzzDeepScanLines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,21 +408,29 @@ fuzzDeepScanLines (int numThreads, Rand48 &random)


void
testFuzzDeepScanLines ()
testFuzzDeepScanLines (const char* file)
{
try
{
cout << "Testing deep scanline-based files "
"with randomly inserted errors" << endl;
if(file)
{
readFile(file);
}
else
{

Rand48 random (1);
cout << "Testing deep scanline-based files "
"with randomly inserted errors" << endl;

fuzzDeepScanLines (0, random);
Rand48 random (1);

if (ILMTHREAD_NAMESPACE::supportsThreads())
fuzzDeepScanLines (2, random);
fuzzDeepScanLines (0, random);

cout << "ok\n" << endl;
if (ILMTHREAD_NAMESPACE::supportsThreads())
fuzzDeepScanLines (2, random);

cout << "ok\n" << endl;
}
}
catch (const std::exception &e)
{
Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImfFuzzTest/testFuzzDeepScanLines.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@



void testFuzzDeepScanLines ();
void testFuzzDeepScanLines (const char* file);

25 changes: 16 additions & 9 deletions OpenEXR/IlmImfFuzzTest/testFuzzDeepTiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void generateRandomFile(const char filename[], int channelCount, int parts , Com
{
for(int x=0;x<data[k].width();x++)
{
delete reinterpret_cast<char *>( data[k][y][x] );
delete [] reinterpret_cast<char *>( data[k][y][x] );
data[k][y][x]=0;
}
}
Expand Down Expand Up @@ -503,23 +503,30 @@ fuzzDeepTiles (int numThreads, Rand48 &random)


void
testFuzzDeepTiles ()
testFuzzDeepTiles (const char* file)
{


try
{
cout << "Testing deep tile-based files "
"with randomly inserted errors" << endl;
if(file)
{
readFile(file);
}
else
{
cout << "Testing deep tile-based files "
"with randomly inserted errors" << endl;

Rand48 random (1);
Rand48 random (1);

fuzzDeepTiles (0, random);
fuzzDeepTiles (0, random);

if (ILMTHREAD_NAMESPACE::supportsThreads())
fuzzDeepTiles (2, random);
if (ILMTHREAD_NAMESPACE::supportsThreads())
fuzzDeepTiles (2, random);

cout << "ok\n" << endl;
cout << "ok\n" << endl;
}
}
catch (const std::exception &e)
{
Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImfFuzzTest/testFuzzDeepTiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@



void testFuzzDeepTiles ();
void testFuzzDeepTiles (const char* file);

Loading

0 comments on commit 6ba11ef

Please sign in to comment.