Fixed crashing on loading malformed font files.

Originally committed to SVN as r2479.
This commit is contained in:
Rodrigo Braz Monteiro 2008-11-23 02:37:25 +00:00
parent f22cfa177e
commit 9c815d3042
1 changed files with 2 additions and 2 deletions

View File

@ -329,7 +329,7 @@ int AssFile::AddLine (wxString data,wxString group,int lasttime,int &version,wxS
}
// Is the filename line?
bool isFilename = (data.Left(10) == _T("fontname: ") && lowGroup == _T("[fonts]")) || (data.Left(10) == _T("filename: ") && lowGroup == _T("[graphics]"));
bool isFilename = (data.Left(10) == _T("fontname: ") || data.Left(10) == _T("filename: "));
// The attachment file is static, since it is built through several calls to this
// After it's done building, it's reset to NULL
@ -355,7 +355,7 @@ int AssFile::AddLine (wxString data,wxString group,int lasttime,int &version,wxS
}
// Valid data?
if (validData) {
if (attach && validData) {
// Insert data
attach->AddData(data);