Skip to content

Commit

Permalink
Don't reject DAT files with map detail set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGLander committed Apr 9, 2023
1 parent d34d2e3 commit 40b396a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/libcc1/Levelset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ long ccl::LevelData::read(ccl::Stream* stream, bool forClipboard)
m_chips = stream->read16();
dataSize -= 3 * sizeof(unsigned short);

if (stream->read16() != 1)
long mapDetail = stream->read16();

if (mapDetail != 1 && mapDetail != 0)
throw ccl::IOError(ccl::RuntimeError::tr("Invalid map data field"));
dataSize -= m_map.read(stream) + sizeof(unsigned short);

Expand Down

0 comments on commit 40b396a

Please sign in to comment.