go-zopfli
go-zopfli copied to clipboard
Invalid output on empty files
trafficstars
zopfli.GzipCompress will return garbage if the input is 0 bytes long.
./testprog | zcat
gzip: out.gz: invalid compressed data--format violated
It will panic if the input is 1 bytes long.
./testprog | zcat
panic: runtime error: index out of range
I have a zopfli_test.go file that shows the problem and a fix for one of the cases.
@jeffallen @foobaz I was surprised to see this was still broken. Can we merge https://github.com/foobaz/go-zopfli/pull/3 to fix?