From 080f470ef1505f0b48deda1ba40c93c62f954704 Mon Sep 17 00:00:00 2001 From: Ted John Date: Thu, 23 Jun 2016 22:20:26 +0100 Subject: [PATCH] suppress invalid header in legacy scores for initial file --- src/scenario_list.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scenario_list.c b/src/scenario_list.c index c2d9538a8a..c92a9a520e 100644 --- a/src/scenario_list.c +++ b/src/scenario_list.c @@ -340,6 +340,12 @@ static bool scenario_scores_legacy_load(const utf8 *path) return false; } + Sint64 fileSize = SDL_RWsize(file); + if (fileSize <= 4) { + // Initial value of scores for RCT2, just ignore + return false; + } + // Load header rct_scenario_scores_header header; if (SDL_RWread(file, &header, 16, 1) != 1) {