When optimizing the attached alpha transparency testcase.png (for verification, the sha1 should be 51c5d42e98cce3f04b451bfe1439aff2dcdd1f43, in case SF.net resizes), the result is a corrupted PNG (corrupted.png).
The compression log is below:
[I] mqudsi@QBook ~/Downloads> optipng -fix ./testcase.png
Processing: ./testcase.png
2168x1472 pixels, PNG format
4x8 bits/pixel, RGB+alpha
IDAT size = 209550 bytes
file size = 213359 bytes
Reducing:
3x8 bits/pixel, RGB
Trying: 8 combinations
zc = 9 zm = 9 zs = 0 f = 0 IDAT size = 87172
Encoding:
zc = 9 zm = 9 zs = 0 f = 0 IDAT size = 87172
Output:
IDAT size = 87172 bytes (122378 bytes decrease)
file size = 90825 bytes (122534 bytes = 57.43% decrease)
[I] mqudsi@QBook ~/Downloads> open testcase.png
[I] mqudsi@QBook ~/Downloads> optipng --version
OptiPNG version "Hg"
Copyright (C) 2001-2012 Cosmin Truta and the Contributing Authors.
Using opnglib version @OPNGLIB_VERSION@
Using opngreduc
Using libpng version 1.6.8
Using zlib version 1.2.8
Using pnmio version 0.3
Using minitiff version 0.1
Using cexcept version 2.0.1-optipng
This program is open-source software, distributed under the zlib license.
See LICENSE.txt for more details.
This works fine with the current version (7.9.1)
does not create currupted output anymore.