if (( #if defined(PNG_READ_INTERLACING_SUPPORTED) png_ptr->interlaced && png_ptr->pass > 6) || (!png_ptr->interlaced && #endif png_ptr->row_number == png_ptr->num_rows-1)) png_error(png_ptr, "Too much data in IDAT chunks");
png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,   png_size_t buffer_length){   int ret;   if ((png_ptr->flags & PNG_FLAG_ZLIB_FINISHED) && buffer_length)      png_error(png_ptr, "Extra compression data");   png_ptr->zstream.next_in = buffer;   png_ptr->zstream.avail_in = (uInt)buffer_length;   for(;;)   {      ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);      if (ret != Z_OK)      {         if (ret == Z_STREAM_END)         {            if (png_ptr->zstream.avail_in)               png_error(png_ptr, "Extra compressed data");            if (!(png_ptr->zstream.avail_out))            {               png_push_process_row(png_ptr);            }            png_ptr->mode |= PNG_AFTER_IDAT;            png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;            break;         }         else if (ret == Z_BUF_ERROR)            break;         else            png_error(png_ptr, "Decompression Error");      }      if (!(png_ptr->zstream.avail_out))      {         png_push_process_row(png_ptr);         png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes;         png_ptr->zstream.next_out = png_ptr->row_buf;      }      else         break;   }}