Skip to content

Commit

Permalink
Merge pull request #30 from TheGLander/tolerate-0-map-detail
Browse files Browse the repository at this point in the history
Don't reject DAT files with map detail set to 0
  • Loading branch information
zrax committed Apr 10, 2023
2 parents 03a4677 + 3fafc59 commit 4bd11e3
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)
uint16_t compressionType = stream->read16();

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

Expand Down

0 comments on commit 4bd11e3

Please sign in to comment.