mirror of https://github.com/OpenTTD/OpenTTD
Codefix: check the table header is actually being read
parent
649ed702cc
commit
32b2de36ef
|
@ -2110,7 +2110,7 @@ static void SlLoadChunk(const ChunkHandler &ch)
|
||||||
/* The header should always be at the start. Read the length; the
|
/* The header should always be at the start. Read the length; the
|
||||||
* Load() should as first action process the header. */
|
* Load() should as first action process the header. */
|
||||||
if (_sl.expect_table_header) {
|
if (_sl.expect_table_header) {
|
||||||
SlIterateArray();
|
if (SlIterateArray() != INT32_MAX) SlErrorCorrupt("Table chunk without header");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (_sl.block_mode) {
|
switch (_sl.block_mode) {
|
||||||
|
@ -2163,7 +2163,7 @@ static void SlLoadCheckChunk(const ChunkHandler &ch)
|
||||||
/* The header should always be at the start. Read the length; the
|
/* The header should always be at the start. Read the length; the
|
||||||
* LoadCheck() should as first action process the header. */
|
* LoadCheck() should as first action process the header. */
|
||||||
if (_sl.expect_table_header) {
|
if (_sl.expect_table_header) {
|
||||||
SlIterateArray();
|
if (SlIterateArray() != INT32_MAX) SlErrorCorrupt("Table chunk without header");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (_sl.block_mode) {
|
switch (_sl.block_mode) {
|
||||||
|
|
Loading…
Reference in New Issue