Merge pull request #66 from Anuken/patch-3

Workaround for gc:arc SIGSEGV in png.nim
This commit is contained in:
treeform 2021-01-23 13:26:43 -08:00 committed by GitHub
commit 962c31671b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -437,9 +437,10 @@ proc encodePng*(
raise newException(PixieError, "Invalid PNG number of channels")
let data = cast[ptr UncheckedArray[uint8]](data)
const signature = [137.uint8, 80, 78, 71, 13, 10, 26, 10]
# Add the PNG file signature
result.add([137.uint8, 80, 78, 71, 13, 10, 26, 10])
result.add(signature)
# Add IHDR
result.addUint32(13.uint32.swap())