I cannot reproduce the bug with asan: :/215937 # ldd /usr/bin/optipng | grep asan libasan.so.8 => /lib64/libasan.so.8 (0x00007f432c800000) :/215937 # optipng -o4 POCoptipng -zm 3 -zc 1 -zw 256 -snip -out optipngtest.png ** Processing: POCoptipng Warning: Bogus data in GIF file Error: Unexpected end of GIF file ** Status report 1 file(s) have been processed. 1 error(s) have been encountered. :/215937 # nor valgrind: $ valgrind -q optipng -o4 POCoptipng -zm 3 -zc 1 -zw 256 -snip -out optipngtest.png ** Processing: POCoptipng Warning: Bogus data in GIF file Error: Unexpected end of GIF file ** Status report 1 file(s) have been processed. 1 error(s) have been encountered. $