Bläddra i källkod

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.
Turo Lamminen 10 år sedan
förälder
incheckning
154760ab52
1 ändrade filer med 1 tillägg och 2 borttagningar
  1. 1 2
      code/ACLoader.cpp

+ 1 - 2
code/ACLoader.cpp

@@ -349,8 +349,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
                 {
                 {
                     if(!GetNextLine())
                     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))
                     if (TokenMatch(buffer,"mat",3))
                     {
                     {