This bug was detected by re-compiling Bob v1, which shipped PGM files containing empty lines (produced by an old version of GIMP).
I added a test to ensure this won't happen again.