Your message dated Sun, 13 Mar 2022 10:21:13 +0000
with message-id <[email protected]>
and subject line Bug#813227: fixed in netpbm-free 2:10.97.00-1
has caused the Debian Bug report #813227,
regarding netpbm-free: diff for NMU version 2:10.0-15.3
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
813227: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813227
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: netpbm-free
Version: 2:10.0-15.2
Severity: normal
Tags: patch pending

[Replace XX with correct value]
Dear maintainer,

I've prepared an NMU for netpbm-free (versioned as 2:10.0-15.3) and
uploaded it to DELAYED/XX. Please feel free to tell me if I
should delay it longer.

Regards.
diff -u netpbm-free-10.0/debian/changelog netpbm-free-10.0/debian/changelog
--- netpbm-free-10.0/debian/changelog
+++ netpbm-free-10.0/debian/changelog
@@ -1,3 +1,11 @@
+netpbm-free (2:10.0-15.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS with libpng1.6 -- see 648131libpng16.patch (Closes: #648131)
+  * Change B-D to libpng-dev (Closes: #662444)
+
+ -- Tobias Frost <[email protected]>  Sat, 30 Jan 2016 16:51:10 +0100
+
 netpbm-free (2:10.0-15.2) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -u netpbm-free-10.0/debian/control netpbm-free-10.0/debian/control
--- netpbm-free-10.0/debian/control
+++ netpbm-free-10.0/debian/control
@@ -4,7 +4,7 @@
 Maintainer: Andreas Barth <[email protected]>
 Uploaders: Steve McIntyre <[email protected]>
 Standards-Version: 3.8.4
-Build-Depends: libtiff5-dev, libjpeg-dev, debhelper (>= 7), libpng12-dev, 
zlib1g-dev, flex, quilt
+Build-Depends: libtiff5-dev, libjpeg-dev, debhelper (>= 7), libpng-dev, 
zlib1g-dev, flex, quilt
 Homepage: http://netpbm.alioth.debian.org
 Vcs-Browser: http://git.debian.org/?p=collab-maint/netpbm.git
 Vcs-Git: git://anonscm.debian.org/collab-maint/netpbm.git
diff -u netpbm-free-10.0/debian/patches/bufferoverflow.patch 
netpbm-free-10.0/debian/patches/bufferoverflow.patch
--- netpbm-free-10.0/debian/patches/bufferoverflow.patch
+++ netpbm-free-10.0/debian/patches/bufferoverflow.patch
@@ -11,0 +12 @@
+
diff -u netpbm-free-10.0/debian/patches/series 
netpbm-free-10.0/debian/patches/series
--- netpbm-free-10.0/debian/patches/series
+++ netpbm-free-10.0/debian/patches/series
@@ -18,0 +19,2 @@
+648131libpng16.patch
+
only in patch2:
unchanged:
--- netpbm-free-10.0.orig/debian/patches/648131libpng16.patch
+++ netpbm-free-10.0/debian/patches/648131libpng16.patch
@@ -0,0 +1,1044 @@
+--- a/pnm/pnmtopng.c
++++ b/pnm/pnmtopng.c
+@@ -93,7 +93,8 @@
+ 
+ #include <string.h>   /* strcat() */
+ #include <limits.h>
+-#include <png.h>      /* includes zlib.h and setjmp.h */
++#include <zlib.h>
++#include <png.h>      /* includes no longer zlib.h and setjmp.h */
+ #define VERSION "2.37.5 (24 October 2000) +netpbm"
+ #include "pnm.h"
+ 
+@@ -142,7 +143,7 @@
+ 
+ /* function prototypes */
+ #ifdef __STDC__
+-static void read_text (png_info *info_ptr, FILE *tfp);
++static void read_text (png_struct *png_ptr, png_info *info_ptr, FILE *tfp);
+ static void pnmtopng_error_handler (png_structp png_ptr, png_const_charp msg);
+ static int convertpnm (FILE *ifp, FILE *afp, FILE *tfp);
+ int main (int argc, char *argv[]);
+@@ -318,9 +319,10 @@
+ 
+ 
+ #ifdef __STDC__
+-static void read_text (png_info *info_ptr, FILE *tfp)
++static void read_text (png_struct *png_ptr, png_info *info_ptr, FILE *tfp)
+ #else
+-static void read_text (info_ptr, tfp)
++static void read_text (png_ptr, info_ptr, tfp)
++png_struct *png_ptr;
+ png_info *info_ptr;
+ FILE *tfp;
+ #endif
+@@ -332,8 +334,8 @@
+   char *cp;
+ 
+   overflow2 (MAXCOMMENTS, (int)sizeof(png_text));
+-  info_ptr->text = (png_text *)malloc2 (MAXCOMMENTS, sizeof (png_text));
+-  if(info_ptr->text == NULL)
++  png_textp text = (png_text *)malloc2 (MAXCOMMENTS, sizeof (png_text));
++  if(text == NULL)
+       pm_error("out of memory");
+   j = 0;
+   textpos = 0;
+@@ -351,11 +353,11 @@
+       if ((textline[0] != ' ') && (textline[0] != '\t')) {
+         /* the following is a not that accurate check on Author or Title */
+         if ((!ztxt) || (textline[0] == 'A') || (textline[0] == 'T'))
+-          info_ptr->text[j].compression = -1;
++          text[j].compression = -1;
+         else
+-          info_ptr->text[j].compression = 0;
++          text[j].compression = 0;
+         cp = malloc (textpos);
+-        info_ptr->text[j].key = cp;
++        text[j].key = cp;
+         i = 0;
+         if (textline[0] == '"') {
+           i++;
+@@ -368,38 +370,39 @@
+         }
+         *(cp++) = '\0';
+         cp = malloc (textpos);
+-        info_ptr->text[j].text = cp;
++        text[j].text = cp;
+         while (textline[i] == ' ' || textline[i] == '\t')
+           i++;
+         strcpy (cp, &textline[i]);
+-        info_ptr->text[j].text_length = strlen (cp);
++        text[j].text_length = strlen (cp);
+         j++;
+       } else {
+         j--;
+-        if (info_ptr->text[j].text_length + textpos <= 0) {
++        if (text[j].text_length + textpos <= 0) {
+           /* malloc() would overflow:  terminate now; lose comment */
+           fprintf(stderr, "Invalid text line, aborting\n");
+           fflush(stderr);
+           c = EOF;
+           break;
+         }
+-        overflow_add(info_ptr->text[j].text_length, textpos);
+-        cp = malloc (info_ptr->text[j].text_length + textpos);
+-        strcpy (cp, info_ptr->text[j].text);
+-        cp[ info_ptr->text[j].text_length ] = '\n';
++        overflow_add(text[j].text_length, textpos);
++        cp = malloc (text[j].text_length + textpos);
++        strcpy (cp, text[j].text);
++        cp[ text[j].text_length ] = '\n';
+         i = 0;
+         while (textline[i] == ' ' || textline[i] == '\t')
+           i++;
+-        strcpy (cp + info_ptr->text[j].text_length + 1, &textline[i]);
+-        free (info_ptr->text[j].text); /* FIXME: see realloc() comment above 
*/
+-        info_ptr->text[j].text = cp;
+-        info_ptr->text[j].text_length = strlen (cp);
++        strcpy (cp + text[j].text_length + 1, &textline[i]);
++        free (text[j].text); /* FIXME: see realloc() comment above */
++        text[j].text = cp;
++        text[j].text_length = strlen (cp);
+         j++;
+       }
+       textpos = 0;
+     }
+   } while (c != EOF);
+-  info_ptr->num_text = j;
++
++  png_set_text(png_ptr, info_ptr, text, j);
+ }
+ 
+ #ifdef __STDC__
+@@ -1460,60 +1463,49 @@
+   }
+ 
+   png_init_io (png_ptr, stdout);
+-  info_ptr->width = cols;
+-  info_ptr->height = rows;
+-  info_ptr->bit_depth = depth;
++
++  int color_type;
+ 
+   if (colorMapped)
+-    info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
++    color_type = PNG_COLOR_TYPE_PALETTE;
+   else if (pnm_type == PPM_TYPE)
+-    info_ptr->color_type = PNG_COLOR_TYPE_RGB;
++    color_type = PNG_COLOR_TYPE_RGB;
+   else
+-    info_ptr->color_type = PNG_COLOR_TYPE_GRAY;
++    color_type = PNG_COLOR_TYPE_GRAY;
+ 
+-  if (alpha && info_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
+-    info_ptr->color_type |= PNG_COLOR_MASK_ALPHA;
++  if (alpha && color_type != PNG_COLOR_TYPE_PALETTE)
++    color_type |= PNG_COLOR_MASK_ALPHA;
+ 
+-  info_ptr->interlace_type = interlace;
++  png_set_IHDR(png_ptr, info_ptr, cols, rows, depth, color_type, interlace,
++               PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+ 
+   /* gAMA chunk */
+   if (gamma != -1.0) {
+-    info_ptr->valid |= PNG_INFO_gAMA;
+-    info_ptr->gamma = gamma;
++    png_set_gAMA(png_ptr, info_ptr, gamma);
+   }
+ 
+   /* cHRM chunk */
+   if (chroma_wx != -1.0) {
+-    info_ptr->valid |= PNG_INFO_cHRM;
+-    info_ptr->x_white = chroma_wx;
+-    info_ptr->y_white = chroma_wy;
+-    info_ptr->x_red = chroma_rx;
+-    info_ptr->y_red = chroma_ry;
+-    info_ptr->x_green = chroma_gx;
+-    info_ptr->y_green = chroma_gy;
+-    info_ptr->x_blue = chroma_bx;
+-    info_ptr->y_blue = chroma_by;
++      png_set_cHRM_fixed(png_ptr, info_ptr,
++                         chroma_wx, chroma_wy,
++                         chroma_rx, chroma_ry,
++                         chroma_gx, chroma_gy,
++                         chroma_bx, chroma_by);
+   }
+ 
+   /* pHYS chunk */
+   if (phys_unit != -1.0) {
+-    info_ptr->valid |= PNG_INFO_pHYs;
+-    info_ptr->x_pixels_per_unit = phys_x;
+-    info_ptr->y_pixels_per_unit = phys_y;
+-    info_ptr->phys_unit_type = phys_unit;
++    png_set_pHYs (png_ptr, info_ptr, phys_x, phys_y, phys_unit);
+   }
+ 
+-  if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
++  if (color_type == PNG_COLOR_TYPE_PALETTE) {
+     createPngPalette(palette_pnm, palette_size, maxval,
+                      trans_pnm, trans_size, alpha_maxval, 
+                      palette, trans);
+-    info_ptr->valid |= PNG_INFO_PLTE;
+-    info_ptr->palette = palette;
+-    info_ptr->num_palette = palette_size;
++    png_set_PLTE(png_ptr, info_ptr, palette, palette_size);
++
+     if (trans_size > 0) {
+-        info_ptr->valid |= PNG_INFO_tRNS;
+-        info_ptr->trans = trans;
+-        info_ptr->num_trans = trans_size;   /* omit opaque values */
++         png_set_tRNS(png_ptr, info_ptr, trans, trans_size, NULL);
+     }
+ 
+     /* creating hIST chunk */
+@@ -1527,18 +1519,19 @@
+             
+         for (i = 0 ; i < MAXCOLORS ; i++)
+             histogram[i] = chv[i].value;
+-        info_ptr->valid |= PNG_INFO_hIST;
+-        info_ptr->hist = histogram;
++
++        png_set_hIST(png_ptr, info_ptr, histogram);
++
+         if (verbose)
+             pm_message ("histogram created");
+     }
+   } else { /* color_type != PNG_COLOR_TYPE_PALETTE */
+-    if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+-        info_ptr->color_type == PNG_COLOR_TYPE_RGB) {
++    png_color_16 trans_values;
++    if (color_type == PNG_COLOR_TYPE_GRAY ||
++        color_type == PNG_COLOR_TYPE_RGB) {
+         if (transparent > 0) {
+-           info_ptr->valid |= PNG_INFO_tRNS;
+-            info_ptr->trans_values = 
+-                xelToPngColor_16(transcolor, maxval, png_maxval);
++            trans_values = xelToPngColor_16(transcolor, maxval, png_maxval);
++            png_set_tRNS(png_ptr, info_ptr, NULL, 1, &trans_values);
+         }
+ 
+     } else {
+@@ -1547,32 +1540,36 @@
+         */
+     }
+     if (verbose) {
+-        if (info_ptr->valid && PNG_INFO_tRNS) 
++        if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
+             pm_message("Transparent color {gray, red, green, blue} = "
+                        "{%d, %d, %d, %d}",
+-                       info_ptr->trans_values.gray,
+-                       info_ptr->trans_values.red,
+-                       info_ptr->trans_values.green,
+-                       info_ptr->trans_values.blue);
++                       trans_values.gray,
++                       trans_values.red,
++                       trans_values.green,
++                       trans_values.blue);
++        }
+         else
+             pm_message("No transparent color");
+     }
+   }
+   /* bKGD chunk */
+   if (background > -1) {
+-      info_ptr->valid |= PNG_INFO_bKGD;
+-      if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
+-          info_ptr->background.index = background_index;
++      png_color_16  background_col;
++      if (color_type == PNG_COLOR_TYPE_PALETTE) {
++          background_col.index = background_index;
++          png_set_bKGD(png_ptr, info_ptr, &background_col);
+       } else {
+-          info_ptr->background = 
+-              xelToPngColor_16(backcolor, maxval, png_maxval);
+-          if (verbose)
++          background_col = xelToPngColor_16(backcolor, maxval, png_maxval);
++          png_set_bKGD(png_ptr, info_ptr, &background_col);
++
++          if (verbose) {
+               pm_message("Writing bKGD chunk with background color "
+                          " {gray, red, green, blue} = {%d, %d, %d, %d}",
+-                         info_ptr->background.gray, 
+-                         info_ptr->background.red, 
+-                         info_ptr->background.green, 
+-                         info_ptr->background.blue ); 
++                         background_col.gray,
++                         background_col.red,
++                         background_col.green,
++                         background_col.blue );
++          }
+       }
+   }
+ 
+@@ -1587,34 +1584,34 @@
+     */
+     /* sBIT chunk */
+     int sbitval;
+-
+-    info_ptr->valid |= PNG_INFO_sBIT;
++    png_color_8 sig_bit;
+ 
+     sbitval = pm_maxvaltobits(maxval);
+ 
+-    if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) {
+-      info_ptr->sig_bit.red   = sbitval;
+-      info_ptr->sig_bit.green = sbitval;
+-      info_ptr->sig_bit.blue  = sbitval;
++    if (color_type & PNG_COLOR_MASK_COLOR) {
++      sig_bit.red   = sbitval;
++      sig_bit.green = sbitval;
++      sig_bit.blue  = sbitval;
+     } else {
+-      info_ptr->sig_bit.gray = sbitval;
++      sig_bit.gray = sbitval;
+     }
+     if (verbose)
+         pm_message("Writing sBIT chunk with sbitval = %d", sbitval);
+ 
+-    if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) {
+-      info_ptr->sig_bit.alpha = pm_maxvaltobits(alpha_maxval);
++    if (color_type & PNG_COLOR_MASK_ALPHA) {
++      sig_bit.alpha = pm_maxvaltobits(alpha_maxval);
+     }
++
++    png_set_sBIT(png_ptr, info_ptr, &sig_bit);
+   }
+ 
+   /* tEXT and zTXT chunks */
+   if ((text) || (ztxt)) {
+-    read_text (info_ptr, tfp);
++    read_text (png_ptr, info_ptr, tfp);
+   }
+ 
+   /* tIME chunk */
+   if (mtime) {
+-    info_ptr->valid |= PNG_INFO_tIME;
+     sscanf (date_string, "%d-%d-%d", &time_struct.tm_year,
+                                      &time_struct.tm_mon,
+                                      &time_struct.tm_mday);
+@@ -1624,7 +1621,10 @@
+     sscanf (time_string, "%d:%d:%d", &time_struct.tm_hour,
+                                      &time_struct.tm_min,
+                                      &time_struct.tm_sec);
+-    png_convert_from_struct_tm (&info_ptr->mod_time, &time_struct);
++
++    png_time modtime;
++    png_convert_from_struct_tm (&modtime, &time_struct);
++    png_set_tIME(png_ptr, info_ptr, &modtime);
+   }
+ 
+   /* explicit filter-type (or none) required */
+@@ -1644,11 +1644,11 @@
+ 
+   if ((text) || (ztxt))
+     /* prevent from being written twice with png_write_end */
+-    info_ptr->num_text = 0;
++    png_set_text(png_ptr, info_ptr, NULL, 0);
+ 
+   if (mtime)
+     /* prevent from being written twice with png_write_end */
+-    info_ptr->valid &= ~PNG_INFO_tIME;
++    png_set_invalid(png_ptr, info_ptr, PNG_INFO_tIME);
+ 
+   /* let libpng take care of, e.g., bit-depth conversions */
+   png_set_packing (png_ptr);
+@@ -1671,12 +1671,12 @@
+               xel p_png;
+               xel const p = xelrow[x];
+               PPM_DEPTH(p_png, p, maxval, png_maxval);
+-              if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+-                  info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
++              if (color_type == PNG_COLOR_TYPE_GRAY ||
++                  color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
+                   if (depth == 16)
+                       *pp++ = PNM_GET1 (p_png) >> 8;
+                   *pp++ = PNM_GET1 (p_png)&0xff;
+-              } else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
++              } else if (color_type == PNG_COLOR_TYPE_PALETTE) {
+                   unsigned int paletteIndex;
+                   if (alpha)
+                       paletteIndex = lookupColorAlpha(caht, &p, 
+@@ -1684,8 +1684,8 @@
+                   else
+                       paletteIndex = ppm_lookupcolor(cht, &p);
+                   *pp++ = paletteIndex;
+-              } else if (info_ptr->color_type == PNG_COLOR_TYPE_RGB ||
+-                         info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
++              } else if (color_type == PNG_COLOR_TYPE_RGB ||
++                         color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
+                   if (depth == 16)
+                       *pp++ = PPM_GETR (p_png) >> 8;
+                   *pp++ = PPM_GETR (p_png)&0xff;
+@@ -1700,7 +1700,7 @@
+                   pm_closer (ifp);
+                   pm_error (" (can't happen) undefined color_type");
+               }
+-              if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) {
++              if (color_type & PNG_COLOR_MASK_ALPHA) {
+                   int const png_alphaval = (int)
+                       alpha_mask[y][x] * (float) png_maxval / maxval +0.5;
+                   if (depth == 16)
+--- a/pnm/pngtopnm.c
++++ b/pnm/pngtopnm.c
+@@ -31,6 +31,8 @@
+  *  compiled with one size in libpng and another size here).  */
+ 
+ #include <math.h>
++#include <string.h>
++#include <zlib.h>
+ #include <png.h>      /* includes zlib.h and setjmp.h */
+ #define VERSION "2.37.4 (5 December 1999) +netpbm"
+ 
+@@ -64,8 +66,8 @@
+ static void store_pixel (xel *pix, png_uint_16 r, png_uint_16 g, png_uint_16 
b,
+                          png_uint_16 a);
+ static int iscolor (png_color c);
+-static void save_text (png_info *info_ptr, FILE *tfp);
+-static void show_time (png_info *info_ptr);
++static void save_text (png_struct *png_ptr, png_info *info_ptr, FILE *tfp);
++static void show_time (png_struct *png_ptr, png_info *info_ptr);
+ static void pngtopnm_error_handler (png_structp png_ptr, png_const_charp msg);
+ static void convertpng (FILE *ifp, FILE *tfp);
+ int main (int argc, char *argv[]);
+@@ -87,7 +89,7 @@
+ static int mtime = FALSE;
+ static jmpbuf_wrapper pngtopnm_jmpbuf_struct;
+ 
+-#define get_png_val(p) _get_png_val (&(p), info_ptr->bit_depth)
++#define get_png_val(p) _get_png_val (&(p), bit_depth)
+ 
+ #ifdef __STDC__
+ static png_uint_16 _get_png_val (png_byte **pp, int bit_depth)
+@@ -156,33 +158,37 @@
+ }
+ 
+ #ifdef __STDC__
+-static void save_text (png_info *info_ptr, FILE *tfp)
++static void save_text (png_struct *png_ptr, png_info *info_ptr, FILE *tfp)
+ #else
+-static void save_text (info_ptr, tfp)
++static void save_text (png_ptr, info_ptr, tfp)
++png_struct *png_ptr;
+ png_info *info_ptr;
+ FILE *tfp;
+ #endif
+ {
+   int i, j, k;
++  png_textp text;
+ 
+-  for (i = 0 ; i < info_ptr->num_text ; i++) {
++  int num_text = png_get_text(png_ptr, info_ptr, &text, NULL);
++
++  for (i = 0 ; i < num_text ; i++) {
+     j = 0;
+-    while (info_ptr->text[i].key[j] != '\0' && info_ptr->text[i].key[j] != ' 
')
++    while (text[i].key[j] != '\0' && text[i].key[j] != ' ')
+       j++;    
+-    if (info_ptr->text[i].key[j] != ' ') {
+-      fprintf (tfp, "%s", info_ptr->text[i].key);
+-      for (j = strlen (info_ptr->text[i].key) ; j < 15 ; j++)
++    if (text[i].key[j] != ' ') {
++      fprintf (tfp, "%s", text[i].key);
++      for (j = strlen (text[i].key) ; j < 15 ; j++)
+         putc (' ', tfp);
+     } else {
+-      fprintf (tfp, "\"%s\"", info_ptr->text[i].key);
+-      for (j = strlen (info_ptr->text[i].key) ; j < 13 ; j++)
++      fprintf (tfp, "\"%s\"", text[i].key);
++      for (j = strlen (text[i].key) ; j < 13 ; j++)
+         putc (' ', tfp);
+     }
+     putc (' ', tfp); /* at least one space between key and text */
+     
+-    for (j = 0 ; j < info_ptr->text[i].text_length ; j++) {
+-      putc (info_ptr->text[i].text[j], tfp);
+-      if (info_ptr->text[i].text[j] == '\n')
++    for (j = 0 ; j < text[i].text_length ; j++) {
++      putc (text[i].text[j], tfp);
++      if (text[i].text[j] == '\n')
+         for (k = 0 ; k < 16 ; k++)
+           putc ((int)' ', tfp);
+     }
+@@ -191,9 +197,10 @@
+ }
+ 
+ #ifdef __STDC__
+-static void show_time (png_info *info_ptr)
++static void show_time (png_struct *png_ptr, png_info *info_ptr)
+ #else
+-static void show_time (info_ptr)
++static void show_time (png_struct *png_ptr, info_ptr)
++png_struct *png_ptr;
+ png_info *info_ptr;
+ #endif
+ {
+@@ -201,11 +208,14 @@
+     {"", "January", "February", "March", "April", "May", "June",
+      "July", "August", "September", "October", "November", "December"};
+ 
+-  if (info_ptr->valid & PNG_INFO_tIME) {
++  if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tIME)) {
++    png_timep mod_time;
++    png_get_tIME(png_ptr, info_ptr, &mod_time);
++    if (mod_time->month > 12) mod_time->month = 0;
+     pm_message ("modification time: %02d %s %d %02d:%02d:%02d",
+-                info_ptr->mod_time.day, month[info_ptr->mod_time.month],
+-                info_ptr->mod_time.year, info_ptr->mod_time.hour,
+-                info_ptr->mod_time.minute, info_ptr->mod_time.second);
++                mod_time->day, month[mod_time->month],
++                mod_time->year, mod_time->hour,
++                mod_time->minute, mod_time->second);
+   }
+ }
+ 
+@@ -310,8 +320,19 @@
+   png_set_sig_bytes (png_ptr, SIG_CHECK_SIZE);
+   png_read_info (png_ptr, info_ptr);
+ 
++  png_uint_32 width;
++  png_uint_32 height;
++  int bit_depth;
++  int color_type;
++  int interlace_type;
++  int compression_method;
++  int filter_method;
++
++  png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
++               &interlace_type, &compression_method, &filter_method);
++
+   if (verbose) {
+-    switch (info_ptr->color_type) {
++    switch (color_type) {
+       case PNG_COLOR_TYPE_GRAY:
+         type_string = "gray";
+         alpha_string = "";
+@@ -337,66 +358,70 @@
+         alpha_string = "+alpha";
+         break;
+     }
+-    if (info_ptr->valid & PNG_INFO_tRNS) {
++    if (png_get_valid(png_ptr, info_ptr,PNG_INFO_tRNS)) {
+       alpha_string = "+transparency";
+     }
+ 
+-    if (info_ptr->valid & PNG_INFO_gAMA) {
+-      sprintf (gamma_string, ", image gamma = %4.2f", info_ptr->gamma);
++    if (png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA)) {
++        double gamma;
++        png_get_gAMA(png_ptr, info_ptr, &gamma);
++      sprintf (gamma_string, ", image gamma = %4.2f", gamma);
+     } else {
+       strcpy (gamma_string, "");
+     }
+ 
+     if (verbose) {
+-      pm_message ("reading a %ldw x %ldh image, %d bit%s %s%s%s%s",
+-                info_ptr->width, info_ptr->height,
+-                info_ptr->bit_depth, info_ptr->bit_depth > 1 ? "s" : "",
++      pm_message ("reading a %dw x %dh image, %d bit%s %s%s%s%s",
++                width, height,
++                bit_depth, bit_depth > 1 ? "s" : "",
+                 type_string, alpha_string, gamma_string,
+-                info_ptr->interlace_type ? ", Adam7 interlaced" : "");
++                interlace_type ? ", Adam7 interlaced" : "");
++      png_color_16p background;
++      png_get_bKGD(png_ptr, info_ptr, &background);
+       pm_message ("background {index, gray, red, green, blue} = "
+                   "{%d, %d, %d, %d, %d}",
+-                  info_ptr->background.index,
+-                  info_ptr->background.gray,
+-                  info_ptr->background.red,
+-                  info_ptr->background.green,
+-                  info_ptr->background.blue);
++                  background->index,
++                  background->gray,
++                  background->red,
++                  background->green,
++                  background->blue);
+     }
+   }
+ 
+-  png_image = (png_byte **)malloc (info_ptr->height * sizeof (png_byte*));
++  png_image = (png_byte **)malloc (height * sizeof (png_byte*));
+   if (png_image == NULL) {
+     png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL);
+     pm_closer (ifp);
+     pm_error ("couldn't allocate space for image");
+   }
+ 
+-  if (info_ptr->bit_depth == 16)
++  if (bit_depth == 16)
+   {
+-    overflow2(2, info_ptr->width);
+-    linesize = 2 * info_ptr->width;
++    overflow2(2, width);
++    linesize = 2 * width;
+   }
+   else
+-    linesize = info_ptr->width;
++    linesize = width;
+ 
+-  if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
++  if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+   {
+     linesize *= 2;
+     overflow2(2, linesize);
+   }
+   else
+-  if (info_ptr->color_type == PNG_COLOR_TYPE_RGB)
++  if (color_type == PNG_COLOR_TYPE_RGB)
+   {
+     overflow2(3, linesize);
+     linesize *= 3;
+   }
+   else
+-  if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
++  if (color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+   {
+     overflow2(4, linesize);
+     linesize *= 4;
+   }
+ 
+-  for (y = 0 ; y < info_ptr->height ; y++) {
++  for (y = 0 ; y < height ; y++) {
+     png_image[y] = malloc (linesize);
+     if (png_image[y] == NULL) {
+       for (x = 0 ; x < y ; x++)
+@@ -408,32 +433,38 @@
+     }
+   }
+ 
+-  if (info_ptr->bit_depth < 8)
++  if (bit_depth < 8)
+     png_set_packing (png_ptr);
+ 
+-  if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
++  if (color_type == PNG_COLOR_TYPE_PALETTE) {
+     maxval = 255;
+   } else {
+-    maxval = (1l << info_ptr->bit_depth) - 1;
++    maxval = (1l << bit_depth) - 1;
+   }
+ 
+   /* gamma-correction */
+   if (displaygamma != -1.0) {
+-    if (info_ptr->valid & PNG_INFO_gAMA) {
+-      if (displaygamma != info_ptr->gamma) {
+-        png_set_gamma (png_ptr, displaygamma, info_ptr->gamma);
+-      totalgamma = (double) info_ptr->gamma * (double) displaygamma;
++    if (png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA)) {
++        double gamma;
++        png_get_gAMA(png_ptr, info_ptr, &gamma);
++
++      if (displaygamma != gamma) {
++        png_set_gamma (png_ptr, displaygamma, gamma);
++      totalgamma = (double) gamma * (double) displaygamma;
+       /* in case of gamma-corrections, sBIT's as in the PNG-file are not 
valid anymore */
+-      info_ptr->valid &= ~PNG_INFO_sBIT;
++        png_set_invalid(png_ptr, info_ptr, PNG_INFO_sBIT);
+         if (verbose)
+           pm_message ("image gamma is %4.2f, converted for display gamma of 
%4.2f",
+-                    info_ptr->gamma, displaygamma);
++                    gamma, displaygamma);
+       }
+     } else {
+-      if (displaygamma != info_ptr->gamma) {
++      double gamma = -1.0;
++      // BUG? gAMA was found to be invalid in the if-path of this else.
++      png_get_gAMA(png_ptr, info_ptr, &gamma);
++      if (displaygamma != gamma) {
+       png_set_gamma (png_ptr, displaygamma, 1.0);
+       totalgamma = (double) displaygamma;
+-      info_ptr->valid &= ~PNG_INFO_sBIT;
++        png_set_invalid(png_ptr, info_ptr, PNG_INFO_sBIT);
+       if (verbose)
+         pm_message ("image gamma assumed 1.0, converted for display gamma of 
%4.2f",
+                     displaygamma);
+@@ -449,17 +480,21 @@
+      so we will use the sBIT info only for transparency, if we know that only
+      solid and fully transparent is used */
+ 
+-  if (info_ptr->valid & PNG_INFO_sBIT) {
++  if (png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT)) {
+     switch (alpha) {
+       case mix:
+-        if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
+-            info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
++        if (color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
++            color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+           break;
+-        if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
+-            (info_ptr->valid & PNG_INFO_tRNS)) {
++        if (color_type == PNG_COLOR_TYPE_PALETTE &&
++            png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
+           trans_mix = TRUE;
+-          for (i = 0 ; i < info_ptr->num_trans ; i++)
+-            if (info_ptr->trans[i] != 0 && info_ptr->trans[i] != 255) {
++          png_bytep trans = NULL;
++          int num_trans = 0;
++          png_color_16p trans_values;
++          png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, &trans_values);
++          for (i = 0 ; i < num_trans ; i++)
++            if (trans[i] != 0 && trans[i] != 255) {
+               trans_mix = FALSE;
+               break;
+             }
+@@ -470,83 +505,103 @@
+         /* else fall though to normal case */
+ 
+       case none:
+-        if ((info_ptr->color_type == PNG_COLOR_TYPE_PALETTE ||
+-             info_ptr->color_type == PNG_COLOR_TYPE_RGB ||
+-             info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
+-            (info_ptr->sig_bit.red != info_ptr->sig_bit.green ||
+-             info_ptr->sig_bit.red != info_ptr->sig_bit.blue) &&
++      {
++        png_color_8p sig_bit;
++        png_get_sBIT(png_ptr, info_ptr, &sig_bit);
++        if ((color_type == PNG_COLOR_TYPE_PALETTE ||
++             color_type == PNG_COLOR_TYPE_RGB ||
++             color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
++            (sig_bit->red != sig_bit->green ||
++             sig_bit->red != sig_bit->blue) &&
+             alpha == none) {
+         pm_message ("different bit depths for color channels not supported");
+-        pm_message ("writing file with %d bit resolution", 
info_ptr->bit_depth);
++        pm_message ("writing file with %d bit resolution", bit_depth);
+         } else {
+-          if ((info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) &&
+-            (info_ptr->sig_bit.red < 255)) {
+-          for (i = 0 ; i < info_ptr->num_palette ; i++) {
+-            info_ptr->palette[i].red   >>= (8 - info_ptr->sig_bit.red);
+-            info_ptr->palette[i].green >>= (8 - info_ptr->sig_bit.green);
+-            info_ptr->palette[i].blue  >>= (8 - info_ptr->sig_bit.blue);
++          if ((color_type == PNG_COLOR_TYPE_PALETTE) &&
++            (sig_bit->red < 255)) {
++            png_colorp palette;
++            int num_palette;
++            png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette);
++
++          for (i = 0 ; i < num_palette ; i++) {
++            palette[i].red   >>= (8 - sig_bit->red);
++            palette[i].green >>= (8 - sig_bit->green);
++            palette[i].blue  >>= (8 - sig_bit->blue);
+           }
+-          maxval = (1l << info_ptr->sig_bit.red) - 1;
++          maxval = (1l << sig_bit->red) - 1;
+           if (verbose)
+             pm_message ("image has fewer significant bits, writing file with 
%d bits per channel", 
+-              info_ptr->sig_bit.red);
++              sig_bit->red);
+           } else
+-          if ((info_ptr->color_type == PNG_COLOR_TYPE_RGB ||
+-               info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
+-            (info_ptr->sig_bit.red < info_ptr->bit_depth)) {
+-          png_set_shift (png_ptr, &(info_ptr->sig_bit));
+-          maxval = (1l << info_ptr->sig_bit.red) - 1;
++          if ((color_type == PNG_COLOR_TYPE_RGB ||
++               color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
++            (sig_bit->red < bit_depth)) {
++          png_set_shift (png_ptr, sig_bit);
++          maxval = (1l << sig_bit->red) - 1;
+           if (verbose)
+             pm_message ("image has fewer significant bits, writing file with 
%d bits per channel", 
+-              info_ptr->sig_bit.red);
++              sig_bit->red);
+           } else 
+-          if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+-               info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) &&
+-            (info_ptr->sig_bit.gray < info_ptr->bit_depth)) {
+-          png_set_shift (png_ptr, &(info_ptr->sig_bit));
+-          maxval = (1l << info_ptr->sig_bit.gray) - 1;
++          if ((color_type == PNG_COLOR_TYPE_GRAY ||
++               color_type == PNG_COLOR_TYPE_GRAY_ALPHA) &&
++            (sig_bit->gray < bit_depth)) {
++          png_set_shift (png_ptr, sig_bit);
++          maxval = (1l << sig_bit->gray) - 1;
+           if (verbose)
+             pm_message ("image has fewer significant bits, writing file with 
%d bits",
+-              info_ptr->sig_bit.gray);
++              sig_bit->gray);
+           }
+         }
+         break;
++      }
+ 
+-      case alpha_only:
+-        if ((info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
+-             info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) && 
+-          (info_ptr->sig_bit.gray < info_ptr->bit_depth)) {
+-        png_set_shift (png_ptr, &(info_ptr->sig_bit));
++      case alpha_only: {
++        png_color_8p sig_bit;
++        png_get_sBIT(png_ptr, info_ptr, &sig_bit);
++
++          if ((color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
++             color_type == PNG_COLOR_TYPE_GRAY_ALPHA) &&
++          (sig_bit->gray < bit_depth)) {
++        png_set_shift (png_ptr, sig_bit);
+         if (verbose)
+           pm_message ("image has fewer significant bits, writing file with %d 
bits", 
+-              info_ptr->sig_bit.alpha);
+-        maxval = (1l << info_ptr->sig_bit.alpha) - 1;
++              sig_bit->alpha);
++        maxval = (1l << sig_bit->alpha) - 1;
+         }
+         break;
++      }
+ 
+       }
+   }
+-
+   /* didn't manage to get libpng to work (bugs?) concerning background */
+   /* processing, therefore we do our own using bgr, bgg and bgb        */
+-  if (info_ptr->valid & PNG_INFO_bKGD)
+-    switch (info_ptr->color_type) {
++  if (png_get_valid(png_ptr, info_ptr,  PNG_INFO_bKGD)) {
++    png_color_16p background;
++    png_get_bKGD(png_ptr, info_ptr, &background);
++
++    switch (color_type) {
+       case PNG_COLOR_TYPE_GRAY:
+       case PNG_COLOR_TYPE_GRAY_ALPHA:
+-        bgr = bgg = bgb = gamma_correct (info_ptr->background.gray, 
totalgamma);
++        bgr = bgg = bgb = gamma_correct (background->gray, totalgamma);
+         break;
+-      case PNG_COLOR_TYPE_PALETTE:
+-        bgr = gamma_correct 
(info_ptr->palette[info_ptr->background.index].red, totalgamma);
+-        bgg = gamma_correct 
(info_ptr->palette[info_ptr->background.index].green, totalgamma);
+-        bgb = gamma_correct 
(info_ptr->palette[info_ptr->background.index].blue, totalgamma);
++      case PNG_COLOR_TYPE_PALETTE: {
++        png_colorp palette;
++        int num_palette;
++        png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette);
++
++        bgr = gamma_correct (palette[background->index].red, totalgamma);
++        bgg = gamma_correct (palette[background->index].green, totalgamma);
++        bgb = gamma_correct (palette[background->index].blue, totalgamma);
+         break;
++      }
+       case PNG_COLOR_TYPE_RGB:
+       case PNG_COLOR_TYPE_RGB_ALPHA:
+-        bgr = gamma_correct (info_ptr->background.red, totalgamma);
+-        bgg = gamma_correct (info_ptr->background.green, totalgamma);
+-        bgb = gamma_correct (info_ptr->background.blue, totalgamma);
++        bgr = gamma_correct (background->red, totalgamma);
++        bgg = gamma_correct (background->green, totalgamma);
++        bgb = gamma_correct (background->blue, totalgamma);
+         break;
+     }
++  }
+   else
+     /* when no background given, we use white [from version 2.37] */
+     bgr = bgg = bgb = maxval;
+@@ -556,7 +611,7 @@
+   if (background > -1)
+   {
+     backcolor = ppm_parsecolor (backstring, maxval);
+-    switch (info_ptr->color_type) {
++    switch (color_type) {
+       case PNG_COLOR_TYPE_GRAY:
+       case PNG_COLOR_TYPE_GRAY_ALPHA:
+         bgr = bgg = bgb = PNM_GET1 (backcolor);
+@@ -575,13 +630,16 @@
+   png_read_end (png_ptr, info_ptr);
+ 
+   if (mtime)
+-    show_time (info_ptr);
++    show_time (png_ptr, info_ptr);
+   if (text)
+-    save_text (info_ptr, tfp);
++    save_text (png_ptr, info_ptr, tfp);
+ 
+-  if (info_ptr->valid & PNG_INFO_pHYs) {
++  if (png_get_valid(png_ptr, info_ptr,  PNG_INFO_pHYs)) {
+     float r;
+-    r = (float)info_ptr->x_pixels_per_unit / info_ptr->y_pixels_per_unit;
++    png_uint_32 x_pixels_per_unit, y_pixels_per_unit;
++    int unit_type;
++    png_get_pHYs(png_ptr, info_ptr, &x_pixels_per_unit, &y_pixels_per_unit, 
&unit_type);
++    r = (float)x_pixels_per_unit / y_pixels_per_unit;
+     if (r != 1.0) {
+       pm_message ("warning - non-square pixels; to fix do a 'pnmscale 
-%cscale %g'",
+                   r < 1.0 ? 'x' : 'y',
+@@ -589,8 +647,8 @@
+     }
+   }
+ 
+-  if ((row = pnm_allocrow (info_ptr->width)) == NULL) {
+-    for (y = 0 ; y < info_ptr->height ; y++)
++  if ((row = pnm_allocrow (width)) == NULL) {
++    for (y = 0 ; y < height ; y++)
+       free (png_image[y]);
+     free (png_image);
+     png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL);
+@@ -599,15 +657,20 @@
+   }
+ 
+   if (alpha == alpha_only) {
+-    if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+-        info_ptr->color_type == PNG_COLOR_TYPE_RGB) {
++    if (color_type == PNG_COLOR_TYPE_GRAY ||
++        color_type == PNG_COLOR_TYPE_RGB) {
+       pnm_type = PBM_TYPE;
+     } else
+-      if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
++      if (color_type == PNG_COLOR_TYPE_PALETTE) {
+         pnm_type = PBM_TYPE;
+-        if (info_ptr->valid & PNG_INFO_tRNS) {
+-          for (i = 0 ; i < info_ptr->num_trans ; i++) {
+-            if (info_ptr->trans[i] != 0 && info_ptr->trans[i] != maxval) {
++        if (png_get_valid(png_ptr, info_ptr,  PNG_INFO_tRNS)) {
++          png_bytep trans = NULL;
++          int num_trans = 0;
++          png_color_16p trans_values;
++          png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, &trans_values);
++
++         for (i = 0 ; i < num_trans ; i++) {
++            if (trans[i] != 0 && trans[i] != maxval) {
+               pnm_type = PGM_TYPE;
+               break;
+             }
+@@ -620,18 +683,21 @@
+           pnm_type = PGM_TYPE;
+       }
+   } else {
+-    if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+-        info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
+-      if (info_ptr->bit_depth == 1) {
++    if (color_type == PNG_COLOR_TYPE_GRAY ||
++        color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
++      if (bit_depth == 1) {
+         pnm_type = PBM_TYPE;
+       } else {
+         pnm_type = PGM_TYPE;
+       }
+     } else
+-    if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
++    if (color_type == PNG_COLOR_TYPE_PALETTE) {
+       pnm_type = PGM_TYPE;
+-      for (i = 0 ; i < info_ptr->num_palette ; i++) {
+-        if (iscolor (info_ptr->palette[i])) {
++      png_colorp palette;
++      int num_palette;
++      png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette);
++      for (i = 0 ; i < num_palette ; i++) {
++        if (iscolor (palette[i])) {
+           pnm_type = PPM_TYPE;
+           break;
+         }
+@@ -655,45 +721,72 @@
+                                        "UNKNOWN!", 
+               maxmaxval);
+ 
+-  pnm_writepnminit (stdout, info_ptr->width, info_ptr->height, maxval,
++  pnm_writepnminit (stdout, width, height, maxval,
+                     pnm_type, FALSE);
+ 
+-  for (y = 0 ; y < info_ptr->height ; y++) {
++  for (y = 0 ; y < height ; y++) {
++
+     png_pixel = png_image[y];
+     pnm_pixel = row;
+-    for (x = 0 ; x < info_ptr->width ; x++) {
++    for (x = 0 ; x < width ; x++) {
+       c = get_png_val (png_pixel);
+-      switch (info_ptr->color_type) {
+-        case PNG_COLOR_TYPE_GRAY:
++      switch (color_type) {
++        case PNG_COLOR_TYPE_GRAY: {
++          png_bytep trans = NULL;
++          int num_trans = 0;
++          png_color_16p trans_values;
++          png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, &trans_values);
++
+           store_pixel (pnm_pixel, c, c, c,
+-              ((info_ptr->valid & PNG_INFO_tRNS) &&
+-               (c == gamma_correct (info_ptr->trans_values.gray, 
totalgamma))) ?
++              ((png_get_valid(png_ptr, info_ptr,  PNG_INFO_tRNS)) &&
++               (c == gamma_correct (trans_values->gray, totalgamma))) ?
+                       0 : maxval);
+           break;
++        }
+ 
+         case PNG_COLOR_TYPE_GRAY_ALPHA:
+           a = get_png_val (png_pixel);
+           store_pixel (pnm_pixel, c, c, c, a);
+           break;
+ 
+-        case PNG_COLOR_TYPE_PALETTE:
+-          store_pixel (pnm_pixel, info_ptr->palette[c].red,
+-                       info_ptr->palette[c].green, info_ptr->palette[c].blue,
+-                       (info_ptr->valid & PNG_INFO_tRNS) &&
+-                        c<info_ptr->num_trans ?
+-                        info_ptr->trans[c] : maxval);
++        case PNG_COLOR_TYPE_PALETTE: {
++          png_colorp palette;
++          int num_palette;
++          png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette);
++
++          png_bytep trans = NULL;
++          int num_trans = 0;
++          png_color_16p trans_values;
++          if (png_get_valid(png_ptr, info_ptr,  PNG_INFO_tRNS)) {
++            png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, 
&trans_values);
++          }
++
++          store_pixel (pnm_pixel, palette[c].red,
++                       palette[c].green, palette[c].blue,
++                       (png_get_valid(png_ptr, info_ptr,  PNG_INFO_tRNS)) &&
++                        c<num_trans ?
++                        trans[c] : maxval);
+           break;
++        }
++
++        case PNG_COLOR_TYPE_RGB: {
++          png_bytep trans = NULL;
++          int num_trans = 0;
++          png_color_16p trans_values;
++          if (png_get_valid(png_ptr, info_ptr,  PNG_INFO_tRNS)) {
++            png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, 
&trans_values);
++          }
+ 
+-        case PNG_COLOR_TYPE_RGB:
+           c2 = get_png_val (png_pixel);
+           c3 = get_png_val (png_pixel);
+           store_pixel (pnm_pixel, c, c2, c3,
+-              ((info_ptr->valid & PNG_INFO_tRNS) &&
+-               (c  == gamma_correct (info_ptr->trans_values.red, totalgamma)) 
&&
+-               (c2 == gamma_correct (info_ptr->trans_values.green, 
totalgamma)) &&
+-               (c3 == gamma_correct (info_ptr->trans_values.blue, 
totalgamma))) ?
++              ((png_get_valid(png_ptr, info_ptr,  PNG_INFO_tRNS)) &&
++               (c  == gamma_correct (trans_values->red, totalgamma)) &&
++               (c2 == gamma_correct (trans_values->green, totalgamma)) &&
++               (c3 == gamma_correct (trans_values->blue, totalgamma))) ?
+                       0 : maxval);
+           break;
++        }
+ 
+         case PNG_COLOR_TYPE_RGB_ALPHA:
+           c2 = get_png_val (png_pixel);
+@@ -704,7 +797,7 @@
+ 
+         default:
+           pnm_freerow (row);
+-          for (i = 0 ; i < info_ptr->height ; i++)
++          for (i = 0 ; i < height ; i++)
+             free (png_image[i]);
+           free (png_image);
+           png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL);
+@@ -713,12 +806,12 @@
+       }
+       pnm_pixel++;
+     }
+-    pnm_writepnmrow (stdout, row, info_ptr->width, maxval, pnm_type, FALSE);
++    pnm_writepnmrow (stdout, row, width, maxval, pnm_type, FALSE);
+   }
+ 
+   fflush(stdout);
+   pnm_freerow (row);
+-  for (y = 0 ; y < info_ptr->height ; y++)
++  for (y = 0 ; y < height ; y++)
+     free (png_image[y]);
+   free (png_image);
+   png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL);

--- End Message ---
--- Begin Message ---
Source: netpbm-free
Source-Version: 2:10.97.00-1
Done: Andreas Tille <[email protected]>

We believe that the bug you reported is fixed in the latest version of
netpbm-free, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Tille <[email protected]> (supplier of updated netpbm-free package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 13 Mar 2022 10:40:03 +0100
Source: netpbm-free
Architecture: source
Version: 2:10.97.00-1
Distribution: unstable
Urgency: medium
Maintainer: Debian PhotoTools Maintainers 
<[email protected]>
Changed-By: Andreas Tille <[email protected]>
Closes: 209957 256402 386388 669365 813227 847241 854978 864796 968024 977007 
1007030
Changes:
 netpbm-free (2:10.97.00-1) unstable; urgency=medium
 .
   * Team upload.
   * New upstream version
      - Closes: #977007, #386388, #847241
     CVE-2017-2579, CVE-2017-2580 and CVE-2017-2581 before 10.61 thus
      - Closes: #854978
   * debian/watch: Use svn mode
   * Move package to Debian Phototools team
     Closes: #813227, #864796
   * Drop debian/gbp.conf by using branch names per team policy
   * Use Python3 in manpage creation
     Closes: #968024
   * Provide userguide in debian/userguide since it is not part of the
     upstream source tarball obtained via svn mode
   * Standards-Version: 4.6.0 (routine-update)
   * debhelper-compat 13 (routine-update)
   * Remove trailing whitespace in debian/changelog (routine-update)
   * Remove trailing whitespace in debian/copyright (routine-update)
   * Remove trailing whitespace in debian/rules (routine-update)
   * Rules-Requires-Root: no (routine-update)
   * Fix day-of-week for changelog entry 1:19940301.2-4.
   * Use d-shlibs to install library and libdevel package
   * DEP3
   * Add Build-Depends: ghostscrip to pass one test
   * Disable two remaining tests that are failing
   * Remove manweb completely since test had shown this does not work at all
   * Try hardening options
   * Enhance long descriptions
     Closes: #209957
   * ppmqvga does not belong to the source any more
     Closes: #256402, #669365
   * Previous upload to experimental switched to 3.0 source format
     Closes: #1007030
   * DEP5
Checksums-Sha1:
 88bbbddb4e5ad0e6d0fda5afd28b1c67094b8dd4 2306 netpbm-free_10.97.00-1.dsc
 47af82b17a5ec1b4cb0e750fbdc9b2fb4cd099c3 2140072 
netpbm-free_10.97.00.orig.tar.xz
 c25d9b6283b3c599939ff526a81f78bf1931348d 1546412 
netpbm-free_10.97.00-1.debian.tar.xz
 b0f2b2ff09a6a63948fcb492a704e8697f09aad5 9180 
netpbm-free_10.97.00-1_amd64.buildinfo
Checksums-Sha256:
 ed5f73de572602dc3bf0596f7d67266426b4ba4bca3f2a4c7240b3db949a2b2c 2306 
netpbm-free_10.97.00-1.dsc
 63052ab4eb3d9724574562f32414a5281de8f43803b89497c99061a347be1112 2140072 
netpbm-free_10.97.00.orig.tar.xz
 430c3381e1d8ff9af282e2412d8705e33a765e557abf937ef911ce03ee2fa901 1546412 
netpbm-free_10.97.00-1.debian.tar.xz
 f4b3f33cc2791d55affc359c7ed7e61a8184f61ba355b112c622472d80cfa08f 9180 
netpbm-free_10.97.00-1_amd64.buildinfo
Files:
 c1b26daf1dfcf45f34262cd63f208dc0 2306 graphics optional 
netpbm-free_10.97.00-1.dsc
 c125efe151ce9221956594f1087de1a4 2140072 graphics optional 
netpbm-free_10.97.00.orig.tar.xz
 98ba2fd02bfc365dbf951c2ef88894bb 1546412 graphics optional 
netpbm-free_10.97.00-1.debian.tar.xz
 a467e463563a067e388babeedad6388c 9180 graphics optional 
netpbm-free_10.97.00-1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCAAvFiEE8fAHMgoDVUHwpmPKV4oElNHGRtEFAmItwEgRHHRpbGxlQGRl
Ymlhbi5vcmcACgkQV4oElNHGRtGs5w//d+roS/1rFtN3he2PY0UjP5U7Vnx6dFz2
+7yUhJKd7/nh7ir/MRgBaii3mclxHUapGAQCPQb1lgJpga+gzgG8VVPqlmKzTCTl
Irdvv+sCwlSX3CoX0auLHPDzOjzpYtXBQS4KYoWP/6GQ7CwQ2IZ1VzJV77ALouQb
acUyV5jCQudbPHdhj20j91WoQu8Qa3P9vK5cyiIV9Lrn7mzNmM7Qa27ojArvydyp
0cd9PlMjwL+UQVozRvu+YFbUu0kUGPgNiCGrWY9Q8BpzMG5tJBfbJ4nzYB0zU09E
kkWXPM81fc2T1DLhd6q2AVnOdAnfWx7KzqAnEZ2NsbSJeqdfuJDzn+6ln93jsA/U
tZCYv6ZRscHBJbkwgR/dONZ4vzHvW6QUzy0QElXLGAIjtLbub3tVz6lhukHLaS2+
cnxsPFfZkJOkb/21Lbf1L0pYexrR7Y9EGhlFtDJRS82rFZib9lGzB5uhqjdYK3SG
oFOoJlhmpvc8e3LXuvFbsnwr5avffrh9AMfs8Wkd9J46q+dZSdOjIudqAOlf8fuW
mG59IoUXe1PCJwiLTyB+b0Nzb6OaZ+9CGiR19WpFiswlk8G9srEQ3Fc0VSTa9Vfz
QqiGRXlA9qvYLfdh454e1Q7h/czBH57t5T7eXOPD0MTiaXnp6pMGlzYRgLOUAm0c
kDPDuhxb7M0=
=2EjJ
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to