Merged branch new-mapblock-v27. Fixes #21 .

This commit is contained in:
Sascha L. Teichmann 2017-02-24 13:33:57 +01:00
commit 9e62c6c318

View File

@ -100,14 +100,19 @@ func NewDecodedBlock(data []byte, colors *Colors) (db *DecodedBlock, err error)
version := data[0] version := data[0]
contentWidth := int(data[2]) contentWidth := Min(int(data[2]), 2)
paramsWidth := int(data[3]) paramsWidth := Min(int(data[3]), 2)
uncompressedLen := nodeCount * (contentWidth + paramsWidth) uncompressedLen := nodeCount * (contentWidth + paramsWidth)
offset := 2 var offset int
if version >= 22 { switch {
case version >= 27:
offset = 6
case version >= 22:
offset = 4 offset = 4
default:
offset = 2
} }
zr := zlibReaderPool.Get().(interface { zr := zlibReaderPool.Get().(interface {