fix crash with damaged EXR files
@@ -1180,11 +1180,14 @@ ScanLineInputFile::ScanLineInputFile(InputPartData* part)
if (!_data->memoryMapped)
{
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 _data;
throw;
@@ -1235,12 +1238,15 @@ ScanLineInputFile::ScanLineInputFile
if (!_data->memoryMapped)
{
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;
delete _data;
throw;
