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:
parent
45e70b605f
commit
0eb35418e8
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user