SFTtech / openage

Free (as in freedom) open source clone of the Age of Empires II engine 🚀
http://openage.dev
Other
12.73k stars 1.12k forks source link

Handle invalid assets gracefully #974

Open zuntrax opened 6 years ago

zuntrax commented 6 years ago

As shown in #972, openage crashes when it encounters invalid sound files. In this case, a field in the header struct had the wrong size, but i can imagine a bunch of other fails like corrupted bistreams or broken graphics taking down the engine. We should be robust against all the nastyness that might be hidden inside the assets. Crashing during a game would be inacceptable, playing silence or rendering a red X would be nice. We should also have proper logging and a way to nicely test asset packs for broken files. Last but not least, we should fuzz our current implementation and have integration tests with corrupt assets in kevin. Ideas, anybody?

TheJJ commented 6 years ago

With the new core engine and nyan as mod provider, we just have to think of this. Failing sounds should just be missing (+ a one-time warning), failing textures should be pink squares (+ the warning), failing nyan files will abort loading the mod.