Merge pull request #39 from mcfx0/master

Fix wrong behavior when data covers two adjacent int64 in fillSection
This commit is contained in:
Tnze
2020-02-19 10:56:07 +08:00
committed by GitHub

View File

@ -82,8 +82,8 @@ func fillSection(s *Section, bpb uint, DataArray []int64, palette []uint) {
data := uint(DataArray[offset/64]) data := uint(DataArray[offset/64])
data >>= offset % 64 data >>= offset % 64
if offset%64 > 64-bpb { if offset%64 > 64-bpb {
l := bpb + offset%64 - 64 l := 64 - offset % 64
data &= uint(DataArray[offset/64+1] << l) data |= uint(DataArray[offset/64+1] << l)
} }
data &= mask data &= mask