Fix a 16-bit overflow for large objects

This commit is contained in:
2018-10-13 02:38:25 +01:00
parent 57fd59e4b2
commit 06625007fc

View File

@@ -135,7 +135,7 @@ func LoadObject(filename string) (*Object, error) {
}
buf := io.LimitReader(f, int64(sprite.PixelSize))
sprite.Data = make([]byte, sprite.Height*sprite.Width)
sprite.Data = make([]byte, int(sprite.Height)*int(sprite.Width))
// The pixel data is RLE-compressed. Uncompress it here.
if err := rle.Expand(buf, sprite.Data); err != nil {