Catch error when decompressing
Make sure we catch errors when thrown by zlib Fixes https://gitlab.com/kicad/code/kicad/issues/5376
This commit is contained in:
parent
3e754e0378
commit
f1b1e59cf0
|
@ -481,7 +481,17 @@ bool readSTEPZ( Handle(TDocStd_Document)& m_doc, const char* aFileName )
|
|||
char *buffer = new char[size];
|
||||
|
||||
ifile.Read( buffer, size);
|
||||
std::string expanded = gzip::decompress( buffer, size );
|
||||
std::string expanded;
|
||||
|
||||
try
|
||||
{
|
||||
expanded = gzip::decompress( buffer, size );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
delete[] buffer;
|
||||
return false;
|
||||
}
|
||||
|
||||
delete[] buffer;
|
||||
|
||||
|
|
|
@ -187,7 +187,17 @@ SCENEGRAPH* LoadVRML( const wxString& aFileName, bool useInline )
|
|||
char *buffer = new char[size];
|
||||
|
||||
ifile.Read( buffer, size);
|
||||
std::string expanded = gzip::decompress( buffer, size );
|
||||
std::string expanded;
|
||||
|
||||
try
|
||||
{
|
||||
expanded = gzip::decompress( buffer, size );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
delete[] buffer;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
delete[] buffer;
|
||||
|
||||
|
|
|
@ -995,7 +995,17 @@ bool PCBMODEL::getModelLabel( const std::string aFileName, TRIPLET aScale, TDF_L
|
|||
char *buffer = new char[size];
|
||||
|
||||
ifile.Read( buffer, size);
|
||||
std::string expanded = gzip::decompress( buffer, size );
|
||||
std::string expanded;
|
||||
|
||||
try
|
||||
{
|
||||
expanded = gzip::decompress( buffer, size );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
delete[] buffer;
|
||||
return false;
|
||||
}
|
||||
|
||||
delete[] buffer;
|
||||
|
||||
|
|
Loading…
Reference in New Issue