Skip to content

Commit

Permalink
Always interpret long_array as 64-bit
Browse files Browse the repository at this point in the history
previously, some arrays could (by chance) be interpreted as smaller integers
  • Loading branch information
agrif authored Aug 8, 2018
1 parent 456f494 commit e6ea080
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion overviewer_core/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def _packed_longarray_to_shorts(self, long_array, n):
bits_per_value = (len(long_array) * 64) / n
if bits_per_value < 4 or 12 < bits_per_value:
raise nbt.CorruptChunkError()
b = numpy.frombuffer(numpy.asarray(long_array), dtype=numpy.uint8)
b = numpy.frombuffer(numpy.asarray(long_array, dtype=numpy.uint64), dtype=numpy.uint8)
if bits_per_value == 8:
result = b.astype(numpy.uint16)
else:
Expand Down

0 comments on commit e6ea080

Please sign in to comment.