Put
number_passes = png_set_interlace_handling(png_ptr);
at the appropriate place in the calling application, just after
png_get_IHDR();
If you don't want to rebuild the calling application, a workaround is to use an application such as ImageMagick's "convert" to de-interlace the PNG before you try to read it with your application:
convert in.png -interlace none out.png