From 9c815d304246991860a641678ca2d912d9e793c8 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Sun, 23 Nov 2008 02:37:25 +0000 Subject: [PATCH] Fixed crashing on loading malformed font files. Originally committed to SVN as r2479. --- aegisub/ass_file.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aegisub/ass_file.cpp b/aegisub/ass_file.cpp index 2ae2067cf..b903beaa2 100644 --- a/aegisub/ass_file.cpp +++ b/aegisub/ass_file.cpp @@ -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);