The calculation of vector size for PNG decoding used Word32 and then converted it to Int. Combined with the copious use of unsafe functions in PNG decoding this lead to segmentation faults on non-small PNGs.
Doing the calculations in the destination type to begin with solves this and even cleans up the code a bit.
The calculation of vector size for PNG decoding used Word32 and then converted it to Int. Combined with the copious use of unsafe functions in PNG decoding this lead to segmentation faults on non-small PNGs.
Doing the calculations in the destination type to begin with solves this and even cleans up the code a bit.