mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 17:19:43 +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.
|
// 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;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
out.Open(tempName, wxT("wb"));
|
out.Open(tempName, wxT("wb"));
|
||||||
if (!out.IsOpened())
|
opened = out.IsOpened();
|
||||||
|
}
|
||||||
|
catch (XMLFileWriterException* pException)
|
||||||
|
{
|
||||||
|
delete pException;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!opened)
|
||||||
{
|
{
|
||||||
delete[] buf;
|
delete[] buf;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user