if (height == 0 || *height > PNG_MAX_UINT)
if (height == 0 || *height > PNG_UINT_31_MAX)
png_get_IHDR(png_structp png_ptr, png_infop info_ptr,   png_uint_32 *width, png_uint_32 *height, int *bit_depth,   int *color_type, int *interlace_type, int *compression_type,   int *filter_type){   if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL &&      bit_depth != NULL && color_type != NULL)   {      int pixel_depth, channels;      png_uint_32 rowbytes_per_pixel;      png_debug1(1, "in %s retrieval function\n", "IHDR");      *width = info_ptr->width;      *height = info_ptr->height;      *bit_depth = info_ptr->bit_depth;      if (info_ptr->bit_depth < 1 || info_ptr->bit_depth > 16)        png_error(png_ptr, "Invalid bit depth");      *color_type = info_ptr->color_type;      if (info_ptr->color_type > 6)        png_error(png_ptr, "Invalid color type");      if (compression_type != NULL)         *compression_type = info_ptr->compression_type;      if (filter_type != NULL)         *filter_type = info_ptr->filter_type;      if (interlace_type != NULL)         *interlace_type = info_ptr->interlace_type;      /* check for potential overflow of rowbytes */      if (*color_type == PNG_COLOR_TYPE_PALETTE)         channels = 1;      else if (*color_type & PNG_COLOR_MASK_COLOR)         channels = 3;      else         channels = 1;      if (*color_type & PNG_COLOR_MASK_ALPHA)         channels++;      pixel_depth = *bit_depth * channels;      rowbytes_per_pixel = (pixel_depth + 7) >> 3;      if (width == 0 || *width > PNG_MAX_UINT)        png_error(png_ptr, "Invalid image width");      if (height == 0 || *height > PNG_MAX_UINT)        png_error(png_ptr, "Invalid image height");      if (*width > PNG_MAX_UINT/rowbytes_per_pixel - 64)      {         png_error(png_ptr,            "Width too large for libpng to process image data.");      }      return (1);   }   return (0);}