(Found while investigating #3140468:)
If the first IDAT block of a PNG is empty (but a valid one follows), OptiPNG will report: ** INTERNAL ERROR: Image rows have been allocated too early
PNG with zero-length first IDAT block
This is an important bug, that I had also discovered, and I already have a fix. Thank you for your report.
There are also issues (although they're unrelated) with empty chunks at or near the end of the IDAT sequence. I fixed that as well.
I'm planning to make a new release over this weekend.
Fixed in v0.6.5.