From 7bab63ecd3303ec16f80994bf92768e9c147fa32 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Tue, 8 Dec 2020 18:59:27 +0000 Subject: [PATCH] Fix #13552: Incorrect value for highscore pointer This was causing an invalid pointer dereference --- src/openrct2/scenario/ScenarioRepository.cpp | 2 +- src/openrct2/scenario/ScenarioRepository.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 807b734e3d65..3c1d38c447a8 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -129,7 +129,7 @@ class ScenarioFileIndex final : public FileIndex { private: static constexpr uint32_t MAGIC_NUMBER = 0x58444953; // SIDX - static constexpr uint16_t VERSION = 4; + static constexpr uint16_t VERSION = 5; static constexpr auto PATTERN = "*.sc4;*.sc6;*.sea"; public: diff --git a/src/openrct2/scenario/ScenarioRepository.h b/src/openrct2/scenario/ScenarioRepository.h index d5ecae363a26..8a1b7b19b8ba 100644 --- a/src/openrct2/scenario/ScenarioRepository.h +++ b/src/openrct2/scenario/ScenarioRepository.h @@ -40,7 +40,7 @@ struct scenario_index_entry uint8_t objective_arg_1; int32_t objective_arg_2; int16_t objective_arg_3; - scenario_highscore_entry* highscore; + scenario_highscore_entry* highscore = nullptr; utf8 internal_name[64]; // Untranslated name utf8 name[64]; // Translated name