From 154760ab52efedc85bc97fa85c0bbf04c07c2b75 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Fri, 7 Aug 2015 14:17:27 +0300 Subject: [PATCH] Abort early when hitting unexpected EOF in AC3D loader Without this the code will try to loop through the specified number of surfaces which could be very large even though none will succeed. --- code/ACLoader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/ACLoader.cpp b/code/ACLoader.cpp index 5b7b6a61d..dac85b8db 100644 --- a/code/ACLoader.cpp +++ b/code/ACLoader.cpp @@ -349,8 +349,7 @@ void AC3DImporter::LoadObjectSection(std::vector& objects) { if(!GetNextLine()) { - DefaultLogger::get()->error("AC3D: Unexpected EOF: surface is incomplete"); - break; + throw DeadlyImportError("AC3D: Unexpected EOF: surface is incomplete"); } if (TokenMatch(buffer,"mat",3)) {