mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 15:23:48 +01:00
Catch exceptions when opening recovery files so we don't crash on corrupt files
This commit is contained in:
@@ -694,10 +694,21 @@ bool AutoSaveFile::Decode(const wxString & fileName)
|
|||||||
// Decode to a temporary file to preserve the orignal.
|
// Decode to a temporary file to preserve the orignal.
|
||||||
wxString tempName = fn.CreateTempFileName(fn.GetPath());
|
wxString tempName = fn.CreateTempFileName(fn.GetPath());
|
||||||
|
|
||||||
|
bool opened = false;
|
||||||
|
|
||||||
XMLFileWriter out;
|
XMLFileWriter out;
|
||||||
|
|
||||||
out.Open(tempName, wxT("wb"));
|
try
|
||||||
if (!out.IsOpened())
|
{
|
||||||
|
out.Open(tempName, wxT("wb"));
|
||||||
|
opened = out.IsOpened();
|
||||||
|
}
|
||||||
|
catch (XMLFileWriterException* pException)
|
||||||
|
{
|
||||||
|
delete pException;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!opened)
|
||||||
{
|
{
|
||||||
delete[] buf;
|
delete[] buf;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user