1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 16:49:41 +02:00

Catch exceptions when opening recovery files so we don't crash on corrupt files

This commit is contained in:
Paul Licameli 2015-05-19 21:48:23 -04:00
parent 45e70b605f
commit 0eb35418e8

View File

@ -694,10 +694,21 @@ bool AutoSaveFile::Decode(const wxString & fileName)
// Decode to a temporary file to preserve the orignal.
wxString tempName = fn.CreateTempFileName(fn.GetPath());
bool opened = false;
XMLFileWriter out;
out.Open(tempName, wxT("wb"));
if (!out.IsOpened())
try
{
out.Open(tempName, wxT("wb"));
opened = out.IsOpened();
}
catch (XMLFileWriterException* pException)
{
delete pException;
}
if (!opened)
{
delete[] buf;