diff --git a/big-endian.patch b/big-endian.patch new file mode 100644 index 0000000..e09dc9c --- /dev/null +++ b/big-endian.patch @@ -0,0 +1,16 @@ +Index: netpbm-10.88.1/converter/pbm/pbmtozinc.c +=================================================================== +--- netpbm-10.88.1.orig/converter/pbm/pbmtozinc.c 2019-12-20 12:48:08.981181384 +0100 ++++ netpbm-10.88.1/converter/pbm/pbmtozinc.c 2019-12-20 12:48:58.121462453 +0100 +@@ -110,7 +110,10 @@ packer_putitem(Packer * const packe + + ++packerP->itemsperline; + +- printf ("0x%02x%02x", hi, lo); ++ if (BYTE_ORDER == LITTLE_ENDIAN) ++ printf ("0x%02x%02x", hi, lo); ++ else ++ printf ("0x%02x%02x", lo, hi); + + } + diff --git a/netpbm-10.96.4-documentation.tar.bz2 b/netpbm-10.96.4-documentation.tar.bz2 new file mode 100644 index 0000000..4f24dde --- /dev/null +++ b/netpbm-10.96.4-documentation.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee4adb85045544aadf604069cf3ce0288447be56353bb0d27c1df46557957315 +size 923460 diff --git a/netpbm-10.96.4-nohpcdtoppm-noppmtompeg.tar.bz2 b/netpbm-10.96.4-nohpcdtoppm-noppmtompeg.tar.bz2 new file mode 100644 index 0000000..7c2e88a --- /dev/null +++ b/netpbm-10.96.4-nohpcdtoppm-noppmtompeg.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b257d6f86f130708d8272e8517aca49f7901aedbba8985abbe0fdbd5a813d31 +size 1995092 diff --git a/netpbm-10.98.2-documentation.tar.bz2 b/netpbm-10.98.2-documentation.tar.bz2 deleted file mode 100644 index 229f98a..0000000 --- a/netpbm-10.98.2-documentation.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:edf670fe9475b8ace51ea66ecf03e54fe460e4bd766889b7566f41913cb7fb2e -size 411947 diff --git a/netpbm-10.98.2-nohpcdtoppm-noppmtompeg.tar.bz2 b/netpbm-10.98.2-nohpcdtoppm-noppmtompeg.tar.bz2 deleted file mode 100644 index 492437b..0000000 --- a/netpbm-10.98.2-nohpcdtoppm-noppmtompeg.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e8c9af0ed22aea8d55ea50493dc122a4560bff205c12797122efbaa74a6912c8 -size 1992862 diff --git a/netpbm-security-code.patch b/netpbm-security-code.patch index 15f59d9..75edbb6 100644 --- a/netpbm-security-code.patch +++ b/netpbm-security-code.patch @@ -1,9 +1,9 @@ -Index: netpbm-10.98.2/analyzer/pgmtexture.c +Index: netpbm-10.96.4/analyzer/pgmtexture.c =================================================================== ---- netpbm-10.98.2.orig/analyzer/pgmtexture.c -+++ netpbm-10.98.2/analyzer/pgmtexture.c -@@ -63,7 +63,7 @@ vector(unsigned int const nl, - unsigned int i; +--- netpbm-10.96.4.orig/analyzer/pgmtexture.c 2021-12-13 13:12:01.856665397 +0100 ++++ netpbm-10.96.4/analyzer/pgmtexture.c 2021-12-13 13:17:36.810714143 +0100 +@@ -53,7 +53,7 @@ vector(unsigned int const nl, + float * v; assert(nh >= nl); - @@ -11,7 +11,7 @@ Index: netpbm-10.98.2/analyzer/pgmtexture.c MALLOCARRAY(v, (unsigned) (nh - nl + 1)); if (v == NULL) -@@ -97,6 +97,7 @@ matrix (unsigned int const nrl, +@@ -85,6 +85,7 @@ matrix (unsigned int const nrl, assert(nrh >= nrl); /* allocate pointers to rows */ @@ -19,7 +19,7 @@ Index: netpbm-10.98.2/analyzer/pgmtexture.c MALLOCARRAY(m, (unsigned) (nrh - nrl + 1)); if (m == NULL) pm_error("Unable to allocate memory for a matrix."); -@@ -104,7 +105,7 @@ matrix (unsigned int const nrl, +@@ -92,7 +93,7 @@ matrix (unsigned int const nrl, m -= ncl; assert (nch >= ncl); @@ -28,10 +28,10 @@ Index: netpbm-10.98.2/analyzer/pgmtexture.c /* allocate rows and set pointers to them */ for (i = nrl; i <= nrh; ++i) { MALLOCARRAY(m[i], (unsigned) (nch - ncl + 1)); -Index: netpbm-10.98.2/converter/other/gemtopnm.c +Index: netpbm-10.96.4/converter/other/gemtopnm.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/gemtopnm.c -+++ netpbm-10.98.2/converter/other/gemtopnm.c +--- netpbm-10.96.4.orig/converter/other/gemtopnm.c 2021-12-13 13:11:49.684590746 +0100 ++++ netpbm-10.96.4/converter/other/gemtopnm.c 2021-12-13 13:17:36.810714143 +0100 @@ -105,7 +105,7 @@ main(argc, argv) type = PPM_TYPE; @@ -41,10 +41,10 @@ Index: netpbm-10.98.2/converter/other/gemtopnm.c { /* allocate input row data structure */ int plane; -Index: netpbm-10.98.2/converter/other/jpegtopnm.c +Index: netpbm-10.96.4/converter/other/jpegtopnm.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/jpegtopnm.c -+++ netpbm-10.98.2/converter/other/jpegtopnm.c +--- netpbm-10.96.4.orig/converter/other/jpegtopnm.c 2021-12-13 13:11:51.248600341 +0100 ++++ netpbm-10.96.4/converter/other/jpegtopnm.c 2021-12-13 13:17:36.810714143 +0100 @@ -862,6 +862,8 @@ convertImage(FILE * /* Calculate output image dimensions so we can allocate space */ jpeg_calc_output_dimensions(cinfoP); @@ -54,10 +54,10 @@ Index: netpbm-10.98.2/converter/other/jpegtopnm.c /* Start decompressor */ jpeg_start_decompress(cinfoP); -Index: netpbm-10.98.2/converter/other/pbmtopgm.c +Index: netpbm-10.96.4/converter/other/pbmtopgm.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/pbmtopgm.c -+++ netpbm-10.98.2/converter/other/pbmtopgm.c +--- netpbm-10.96.4.orig/converter/other/pbmtopgm.c 2021-12-13 13:11:50.244594183 +0100 ++++ netpbm-10.96.4/converter/other/pbmtopgm.c 2021-12-13 13:17:36.810714143 +0100 @@ -60,6 +60,7 @@ main(int argc, char *argv[]) { @@ -66,10 +66,10 @@ Index: netpbm-10.98.2/converter/other/pbmtopgm.c maxval = MIN(PGM_OVERALLMAXVAL, width*height); pgm_writepgminit(stdout, cols, rows, maxval, 0) ; -Index: netpbm-10.98.2/converter/other/pnmtoddif.c +Index: netpbm-10.96.4/converter/other/pnmtoddif.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/pnmtoddif.c -+++ netpbm-10.98.2/converter/other/pnmtoddif.c +--- netpbm-10.96.4.orig/converter/other/pnmtoddif.c 2021-12-13 13:11:50.244594183 +0100 ++++ netpbm-10.96.4/converter/other/pnmtoddif.c 2021-12-13 13:17:36.810714143 +0100 @@ -629,6 +629,7 @@ main(int argc, char *argv[]) { switch (PNM_FORMAT_TYPE(format)) { case PBM_TYPE: @@ -86,10 +86,10 @@ Index: netpbm-10.98.2/converter/other/pnmtoddif.c ip.bytes_per_line = 3 * cols; ip.bits_per_pixel = 24; ip.spectral = 5; -Index: netpbm-10.98.2/converter/other/pnmtojpeg.c +Index: netpbm-10.96.4/converter/other/pnmtojpeg.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/pnmtojpeg.c -+++ netpbm-10.98.2/converter/other/pnmtojpeg.c +--- netpbm-10.96.4.orig/converter/other/pnmtojpeg.c 2021-12-13 13:11:50.244594183 +0100 ++++ netpbm-10.96.4/converter/other/pnmtojpeg.c 2021-12-13 13:17:36.810714143 +0100 @@ -606,7 +606,11 @@ read_scan_script(j_compress_ptr const ci want JPOOL_PERMANENT. */ @@ -120,10 +120,10 @@ Index: netpbm-10.98.2/converter/other/pnmtojpeg.c buffer = (*cinfo_p->mem->alloc_sarray) ((j_common_ptr) cinfo_p, JPOOL_IMAGE, (unsigned int) cinfo_p->image_width * cinfo_p->input_components, -Index: netpbm-10.98.2/converter/other/pnmtops.c +Index: netpbm-10.96.4/converter/other/pnmtops.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/pnmtops.c -+++ netpbm-10.98.2/converter/other/pnmtops.c +--- netpbm-10.96.4.orig/converter/other/pnmtops.c 2021-12-13 13:11:48.824585472 +0100 ++++ netpbm-10.96.4/converter/other/pnmtops.c 2021-12-13 13:17:36.810714143 +0100 @@ -294,17 +294,21 @@ parseCommandLine(int argc, const char ** validateCompDimension(width, 72, "-width value"); validateCompDimension(height, 72, "-height value"); @@ -147,10 +147,10 @@ Index: netpbm-10.98.2/converter/other/pnmtops.c cmdlineP->imageheight = imageheight * 72; } else -Index: netpbm-10.98.2/converter/other/pnmtorle.c +Index: netpbm-10.96.4/converter/other/pnmtorle.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/pnmtorle.c -+++ netpbm-10.98.2/converter/other/pnmtorle.c +--- netpbm-10.96.4.orig/converter/other/pnmtorle.c 2021-12-13 13:11:50.248594206 +0100 ++++ netpbm-10.96.4/converter/other/pnmtorle.c 2021-12-13 13:17:36.810714143 +0100 @@ -19,6 +19,8 @@ * If you modify this software, you should include a notice giving the * name of the person performing the modification, the date of modification, @@ -160,10 +160,10 @@ Index: netpbm-10.98.2/converter/other/pnmtorle.c */ /* * pnmtorle - A program which will convert pbmplus (ppm or pgm) images -Index: netpbm-10.98.2/converter/other/pnmtosgi.c +Index: netpbm-10.96.4/converter/other/pnmtosgi.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/pnmtosgi.c -+++ netpbm-10.98.2/converter/other/pnmtosgi.c +--- netpbm-10.96.4.orig/converter/other/pnmtosgi.c 2021-12-13 13:11:50.252594232 +0100 ++++ netpbm-10.96.4/converter/other/pnmtosgi.c 2021-12-13 13:17:36.810714143 +0100 @@ -185,6 +185,7 @@ buildChannels(FILE * const ifP, ScanElem * temp; @@ -172,10 +172,10 @@ Index: netpbm-10.98.2/converter/other/pnmtosgi.c MALLOCARRAY_NOFAIL(table, channels * rows); } else table = NULL; -Index: netpbm-10.98.2/converter/other/rletopnm.c +Index: netpbm-10.96.4/converter/other/rletopnm.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/rletopnm.c -+++ netpbm-10.98.2/converter/other/rletopnm.c +--- netpbm-10.96.4.orig/converter/other/rletopnm.c 2021-12-13 13:11:51.244600317 +0100 ++++ netpbm-10.96.4/converter/other/rletopnm.c 2021-12-13 13:17:36.810714143 +0100 @@ -19,6 +19,8 @@ * If you modify this software, you should include a notice giving the * name of the person performing the modification, the date of modification, @@ -185,10 +185,10 @@ Index: netpbm-10.98.2/converter/other/rletopnm.c */ /* * rletopnm - A conversion program to convert from Utah's "rle" image format -Index: netpbm-10.98.2/converter/other/sgitopnm.c +Index: netpbm-10.96.4/converter/other/sgitopnm.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/sgitopnm.c -+++ netpbm-10.98.2/converter/other/sgitopnm.c +--- netpbm-10.96.4.orig/converter/other/sgitopnm.c 2021-12-13 13:11:51.244600317 +0100 ++++ netpbm-10.96.4/converter/other/sgitopnm.c 2021-12-13 13:17:36.810714143 +0100 @@ -377,10 +377,14 @@ readChannels(FILE * const ifP, MALLOCARRAY_NOFAIL(image, head->ysize); } else { @@ -205,10 +205,10 @@ Index: netpbm-10.98.2/converter/other/sgitopnm.c for (channel = 0; channel < maxchannel; ++channel) { unsigned int row; -Index: netpbm-10.98.2/converter/other/sirtopnm.c +Index: netpbm-10.96.4/converter/other/sirtopnm.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/sirtopnm.c -+++ netpbm-10.98.2/converter/other/sirtopnm.c +--- netpbm-10.96.4.orig/converter/other/sirtopnm.c 2021-12-13 13:11:51.272600489 +0100 ++++ netpbm-10.96.4/converter/other/sirtopnm.c 2021-12-13 13:17:36.810714143 +0100 @@ -69,6 +69,7 @@ char* argv[]; } break; @@ -217,10 +217,10 @@ Index: netpbm-10.98.2/converter/other/sirtopnm.c picsize = cols * rows * 3; planesize = cols * rows; if ( !( sirarray = (unsigned char*) malloc( picsize ) ) ) -Index: netpbm-10.98.2/converter/other/tifftopnm.c +Index: netpbm-10.96.4/converter/other/tifftopnm.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/tifftopnm.c -+++ netpbm-10.98.2/converter/other/tifftopnm.c +--- netpbm-10.96.4.orig/converter/other/tifftopnm.c 2021-12-13 13:11:50.744597250 +0100 ++++ netpbm-10.96.4/converter/other/tifftopnm.c 2021-12-13 13:17:36.810714143 +0100 @@ -1372,7 +1372,9 @@ convertRasterByRows(pnmOut * const if (scanbuf == NULL) pm_error("can't allocate memory for scanline buffer"); @@ -232,10 +232,10 @@ Index: netpbm-10.98.2/converter/other/tifftopnm.c if (samplebuf == NULL) pm_error("can't allocate memory for row buffer"); -Index: netpbm-10.98.2/converter/other/xwdtopnm.c +Index: netpbm-10.96.4/converter/other/xwdtopnm.c =================================================================== ---- netpbm-10.98.2.orig/converter/other/xwdtopnm.c -+++ netpbm-10.98.2/converter/other/xwdtopnm.c +--- netpbm-10.96.4.orig/converter/other/xwdtopnm.c 2021-12-13 13:11:49.684590746 +0100 ++++ netpbm-10.96.4/converter/other/xwdtopnm.c 2021-12-13 13:17:36.810714143 +0100 @@ -210,6 +210,10 @@ processX10Header(X10WDFileHeader * cons *colorsP = pnm_allocrow(2); PNM_ASSIGN1((*colorsP)[0], 0); @@ -247,7 +247,7 @@ Index: netpbm-10.98.2/converter/other/xwdtopnm.c *padrightP = (((h10P->pixmap_width + 15) / 16) * 16 - h10P->pixmap_width) * 8; *bits_per_itemP = 16; -@@ -638,6 +642,7 @@ processX11Header(X11WDFileHeader * cons +@@ -635,6 +639,7 @@ processX11Header(X11WDFileHeader * cons *colsP = h11FixedP->pixmap_width; *rowsP = h11FixedP->pixmap_height; @@ -255,10 +255,10 @@ Index: netpbm-10.98.2/converter/other/xwdtopnm.c *padrightP = h11FixedP->bytes_per_line * 8 - h11FixedP->pixmap_width * h11FixedP->bits_per_pixel; -Index: netpbm-10.98.2/converter/pbm/mdatopbm.c +Index: netpbm-10.96.4/converter/pbm/mdatopbm.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/mdatopbm.c -+++ netpbm-10.98.2/converter/pbm/mdatopbm.c +--- netpbm-10.96.4.orig/converter/pbm/mdatopbm.c 2021-12-13 13:11:51.256600390 +0100 ++++ netpbm-10.96.4/converter/pbm/mdatopbm.c 2021-12-13 13:17:36.814714167 +0100 @@ -245,10 +245,13 @@ main(int argc, char **argv) { pm_readlittleshort(infile, &yy); nInCols = yy; } @@ -274,23 +274,23 @@ Index: netpbm-10.98.2/converter/pbm/mdatopbm.c data = pbm_allocarray(nOutCols, nOutRows); -Index: netpbm-10.98.2/converter/pbm/mgrtopbm.c +Index: netpbm-10.96.4/converter/pbm/mgrtopbm.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/mgrtopbm.c -+++ netpbm-10.98.2/converter/pbm/mgrtopbm.c -@@ -105,6 +105,8 @@ readMgrHeader(FILE * const ifP, +--- netpbm-10.96.4.orig/converter/pbm/mgrtopbm.c 2021-12-13 13:17:36.814714167 +0100 ++++ netpbm-10.96.4/converter/pbm/mgrtopbm.c 2021-12-13 13:22:52.624641835 +0100 +@@ -104,6 +104,8 @@ readMgrHeader(FILE * const ifP, + interpHdrWidth (head, colsP); interpHdrHeight(head, rowsP); - -+ overflow_add(*colsP, pad); + - *padrightP = ((*colsP + pad - 1) / pad) * pad - *colsP; ++ overflow_add(*colsP, pad); + + *padrightP = ( ( *colsP + pad - 1 ) / pad ) * pad - *colsP; } - -Index: netpbm-10.98.2/converter/pbm/pbmtogem.c +Index: netpbm-10.96.4/converter/pbm/pbmtogem.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/pbmtogem.c -+++ netpbm-10.98.2/converter/pbm/pbmtogem.c +--- netpbm-10.96.4.orig/converter/pbm/pbmtogem.c 2021-12-13 13:11:51.256600390 +0100 ++++ netpbm-10.96.4/converter/pbm/pbmtogem.c 2021-12-13 13:17:36.814714167 +0100 @@ -79,6 +79,7 @@ putinit (int const rows, int const cols) bitsperitem = 0; bitshift = 7; @@ -299,10 +299,10 @@ Index: netpbm-10.98.2/converter/pbm/pbmtogem.c outmax = (cols + 7) / 8; outrow = (unsigned char *) pm_allocrow (outmax, sizeof (unsigned char)); lastrow = (unsigned char *) pm_allocrow (outmax, sizeof (unsigned char)); -Index: netpbm-10.98.2/converter/pbm/pbmtogo.c +Index: netpbm-10.96.4/converter/pbm/pbmtogo.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/pbmtogo.c -+++ netpbm-10.98.2/converter/pbm/pbmtogo.c +--- netpbm-10.96.4.orig/converter/pbm/pbmtogo.c 2021-12-13 13:11:51.340600906 +0100 ++++ netpbm-10.96.4/converter/pbm/pbmtogo.c 2021-12-13 13:17:36.814714167 +0100 @@ -158,6 +158,7 @@ main(int argc, bitrow = pbm_allocrow(cols); @@ -311,10 +311,10 @@ Index: netpbm-10.98.2/converter/pbm/pbmtogo.c rucols = ( cols + 7 ) / 8; bytesperrow = rucols; /* GraphOn uses bytes */ rucols = rucols * 8; -Index: netpbm-10.98.2/converter/pbm/pbmtolj.c +Index: netpbm-10.96.4/converter/pbm/pbmtolj.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/pbmtolj.c -+++ netpbm-10.98.2/converter/pbm/pbmtolj.c +--- netpbm-10.96.4.orig/converter/pbm/pbmtolj.c 2021-12-13 13:11:51.364601052 +0100 ++++ netpbm-10.96.4/converter/pbm/pbmtolj.c 2021-12-13 13:17:36.814714167 +0100 @@ -120,7 +120,11 @@ parseCommandLine(int argc, char ** argv, static void allocateBuffers(unsigned int const cols) { @@ -327,10 +327,10 @@ Index: netpbm-10.98.2/converter/pbm/pbmtolj.c packBufferSize = rowBufferSize + (rowBufferSize + 127) / 128 + 1; deltaBufferSize = rowBufferSize + rowBufferSize / 8 + 10; -Index: netpbm-10.98.2/converter/pbm/pbmtomda.c +Index: netpbm-10.96.4/converter/pbm/pbmtomda.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/pbmtomda.c -+++ netpbm-10.98.2/converter/pbm/pbmtomda.c +--- netpbm-10.96.4.orig/converter/pbm/pbmtomda.c 2021-12-13 13:11:51.572602329 +0100 ++++ netpbm-10.96.4/converter/pbm/pbmtomda.c 2021-12-13 13:17:36.814714167 +0100 @@ -179,6 +179,7 @@ int main(int argc, char **argv) nOutRowsUnrounded = bScale ? nInRows/2 : nInRows; @@ -339,10 +339,10 @@ Index: netpbm-10.98.2/converter/pbm/pbmtomda.c nOutRows = ((nOutRowsUnrounded + 3) / 4) * 4; /* MDA wants rows a multiple of 4 */ nOutCols = nInCols / 8; -Index: netpbm-10.98.2/converter/pbm/pbmtoppa/pbm.c +Index: netpbm-10.96.4/converter/pbm/pbmtoppa/pbm.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/pbmtoppa/pbm.c -+++ netpbm-10.98.2/converter/pbm/pbmtoppa/pbm.c +--- netpbm-10.96.4.orig/converter/pbm/pbmtoppa/pbm.c 2021-12-13 13:11:51.264600439 +0100 ++++ netpbm-10.96.4/converter/pbm/pbmtoppa/pbm.c 2021-12-13 13:17:36.814714167 +0100 @@ -154,6 +154,7 @@ pbm_readline(pbm_stat * const pbmSt break; case P4: { @@ -359,10 +359,10 @@ Index: netpbm-10.98.2/converter/pbm/pbmtoppa/pbm.c pbmStatP->revdata = malloc ((pbmStatP->width+7)/8); memcpy(pbmStatP->revdata, data, (pbmStatP->width+7)/8); --pbmStatP->current_line; -Index: netpbm-10.98.2/converter/pbm/pbmtoppa/pbmtoppa.c +Index: netpbm-10.96.4/converter/pbm/pbmtoppa/pbmtoppa.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/pbmtoppa/pbmtoppa.c -+++ netpbm-10.98.2/converter/pbm/pbmtoppa/pbmtoppa.c +--- netpbm-10.96.4.orig/converter/pbm/pbmtoppa/pbmtoppa.c 2021-12-13 13:11:51.264600439 +0100 ++++ netpbm-10.96.4/converter/pbm/pbmtoppa/pbmtoppa.c 2021-12-13 13:17:36.814714167 +0100 @@ -453,6 +453,7 @@ main(int argc, char *argv[]) { pm_error("main(): unrecognized parameter '%s'", argv[argn]); } @@ -371,10 +371,10 @@ Index: netpbm-10.98.2/converter/pbm/pbmtoppa/pbmtoppa.c Pwidth=(Width+7)/8; printer.fptr=out; -Index: netpbm-10.98.2/converter/pbm/pbmtoxbm.c +Index: netpbm-10.96.4/converter/pbm/pbmtoxbm.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/pbmtoxbm.c -+++ netpbm-10.98.2/converter/pbm/pbmtoxbm.c +--- netpbm-10.96.4.orig/converter/pbm/pbmtoxbm.c 2021-12-13 13:11:51.368601078 +0100 ++++ netpbm-10.96.4/converter/pbm/pbmtoxbm.c 2021-12-13 13:17:36.814714167 +0100 @@ -353,6 +353,8 @@ convertRaster(FILE * const ifP, unsigned char * bitrow; unsigned int row; @@ -384,10 +384,10 @@ Index: netpbm-10.98.2/converter/pbm/pbmtoxbm.c putinit(xbmVersion); bitrow = pbm_allocrow_packed(cols + padright); -Index: netpbm-10.98.2/converter/pbm/pbmto4425.c +Index: netpbm-10.96.4/converter/pbm/pbmto4425.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/pbmto4425.c -+++ netpbm-10.98.2/converter/pbm/pbmto4425.c +--- netpbm-10.96.4.orig/converter/pbm/pbmto4425.c 2021-12-13 13:11:51.552602205 +0100 ++++ netpbm-10.96.4/converter/pbm/pbmto4425.c 2021-12-13 13:17:36.814714167 +0100 @@ -2,6 +2,7 @@ #include "nstring.h" @@ -405,10 +405,10 @@ Index: netpbm-10.98.2/converter/pbm/pbmto4425.c if(vmap == NULL) { pm_error( "Cannot allocate memory" ); -Index: netpbm-10.98.2/converter/pbm/pktopbm.c +Index: netpbm-10.96.4/converter/pbm/pktopbm.c =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/pktopbm.c -+++ netpbm-10.98.2/converter/pbm/pktopbm.c +--- netpbm-10.96.4.orig/converter/pbm/pktopbm.c 2021-12-13 13:11:51.376601127 +0100 ++++ netpbm-10.96.4/converter/pbm/pktopbm.c 2021-12-13 13:17:36.814714167 +0100 @@ -280,6 +280,7 @@ main(int argc, char *argv[]) { if (flagbyte == 7) { /* long form preamble */ integer packetlength = get32() ; /* character packet length */ @@ -417,10 +417,10 @@ Index: netpbm-10.98.2/converter/pbm/pktopbm.c endofpacket = packetlength + pktopbm_pkloc; /* calculate end of packet */ if ((car >= MAXPKCHAR) || !filename[car]) { -Index: netpbm-10.98.2/converter/pbm/thinkjettopbm.l +Index: netpbm-10.96.4/converter/pbm/thinkjettopbm.l =================================================================== ---- netpbm-10.98.2.orig/converter/pbm/thinkjettopbm.l -+++ netpbm-10.98.2/converter/pbm/thinkjettopbm.l +--- netpbm-10.96.4.orig/converter/pbm/thinkjettopbm.l 2021-12-13 13:11:51.572602329 +0100 ++++ netpbm-10.96.4/converter/pbm/thinkjettopbm.l 2021-12-13 13:17:36.814714167 +0100 @@ -114,7 +114,9 @@ DIG [0-9] \033\*b{DIG}+W { int l; @@ -440,10 +440,10 @@ Index: netpbm-10.98.2/converter/pbm/thinkjettopbm.l pbm_writepbminit(stdout, maxRowLength*8, rowCount, 0); packed_bitrow = malloc(maxRowLength); -Index: netpbm-10.98.2/converter/pgm/lispmtopgm.c +Index: netpbm-10.96.4/converter/pgm/lispmtopgm.c =================================================================== ---- netpbm-10.98.2.orig/converter/pgm/lispmtopgm.c -+++ netpbm-10.98.2/converter/pgm/lispmtopgm.c +--- netpbm-10.96.4.orig/converter/pgm/lispmtopgm.c 2021-12-13 13:11:54.848622422 +0100 ++++ netpbm-10.96.4/converter/pgm/lispmtopgm.c 2021-12-13 13:17:36.814714167 +0100 @@ -58,6 +58,7 @@ main( argc, argv ) pm_error( "depth (%d bits) is too large", depth); @@ -463,10 +463,10 @@ Index: netpbm-10.98.2/converter/pgm/lispmtopgm.c *padrightP = ( ( *colsP + 31 ) / 32 ) * 32 - *colsP; if ( *colsP != (cols_32 - *padrightP) ) { -Index: netpbm-10.98.2/converter/pgm/psidtopgm.c +Index: netpbm-10.96.4/converter/pgm/psidtopgm.c =================================================================== ---- netpbm-10.98.2.orig/converter/pgm/psidtopgm.c -+++ netpbm-10.98.2/converter/pgm/psidtopgm.c +--- netpbm-10.96.4.orig/converter/pgm/psidtopgm.c 2021-12-13 13:11:54.852622445 +0100 ++++ netpbm-10.96.4/converter/pgm/psidtopgm.c 2021-12-13 13:17:36.814714167 +0100 @@ -78,6 +78,7 @@ main(int argc, pm_error("bits/sample (%d) is too large.", bitspersample); @@ -475,10 +475,10 @@ Index: netpbm-10.98.2/converter/pgm/psidtopgm.c grayrow = pgm_allocrow((cols + 7) / 8 * 8); for (row = 0; row < rows; ++row) { unsigned int col; -Index: netpbm-10.98.2/converter/ppm/ilbmtoppm.c +Index: netpbm-10.96.4/converter/ppm/ilbmtoppm.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ilbmtoppm.c -+++ netpbm-10.98.2/converter/ppm/ilbmtoppm.c +--- netpbm-10.96.4.orig/converter/ppm/ilbmtoppm.c 2021-12-13 13:11:54.080617711 +0100 ++++ netpbm-10.96.4/converter/ppm/ilbmtoppm.c 2021-12-13 13:17:36.814714167 +0100 @@ -608,6 +608,7 @@ decode_row(FILE * const ifP, rawtype *chp; @@ -550,10 +550,10 @@ Index: netpbm-10.98.2/converter/ppm/ilbmtoppm.c MALLOCARRAY_NOFAIL(ilbmrow, RowBytes(bmhdP->w)); *viewportmodesP |= fakeviewport; /* -isham/-isehb */ -Index: netpbm-10.98.2/converter/ppm/imgtoppm.c +Index: netpbm-10.96.4/converter/ppm/imgtoppm.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/imgtoppm.c -+++ netpbm-10.98.2/converter/ppm/imgtoppm.c +--- netpbm-10.96.4.orig/converter/ppm/imgtoppm.c 2021-12-13 13:11:54.844622398 +0100 ++++ netpbm-10.96.4/converter/ppm/imgtoppm.c 2021-12-13 13:17:36.814714167 +0100 @@ -84,6 +84,7 @@ main(int argc, char ** argv) { len = atoi((char*) buf ); if ( fread( buf, len, 1, ifp ) != 1 ) @@ -570,10 +570,10 @@ Index: netpbm-10.98.2/converter/ppm/imgtoppm.c if ( len != cols * rows ) pm_message( "pixel data length (%d) does not match image size (%d)", -Index: netpbm-10.98.2/converter/ppm/Makefile +Index: netpbm-10.96.4/converter/ppm/Makefile =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/Makefile -+++ netpbm-10.98.2/converter/ppm/Makefile +--- netpbm-10.96.4.orig/converter/ppm/Makefile 2021-12-13 13:11:54.188618373 +0100 ++++ netpbm-10.96.4/converter/ppm/Makefile 2021-12-13 13:17:36.814714167 +0100 @@ -11,7 +11,7 @@ SUBDIRS = hpcdtoppm ppmtompeg PORTBINARIES = 411toppm eyuvtoppm gouldtoppm ilbmtoppm imgtoppm \ @@ -583,10 +583,10 @@ Index: netpbm-10.98.2/converter/ppm/Makefile ppmtoacad ppmtoapplevol ppmtoarbtxt ppmtoascii \ ppmtobmp ppmtoeyuv ppmtogif ppmtoicr ppmtoilbm \ ppmtoleaf ppmtolj ppmtomitsu ppmtoneo \ -Index: netpbm-10.98.2/converter/ppm/pcxtoppm.c +Index: netpbm-10.96.4/converter/ppm/pcxtoppm.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/pcxtoppm.c -+++ netpbm-10.98.2/converter/ppm/pcxtoppm.c +--- netpbm-10.96.4.orig/converter/ppm/pcxtoppm.c 2021-12-13 13:11:54.856622471 +0100 ++++ netpbm-10.96.4/converter/ppm/pcxtoppm.c 2021-12-13 13:17:36.814714167 +0100 @@ -409,6 +409,7 @@ pcx_planes_to_pixels(pixels, bitplanes, /* * clear the pixel buffer @@ -603,20 +603,20 @@ Index: netpbm-10.98.2/converter/ppm/pcxtoppm.c rawcols = BytesPerLine * 8 / BitsPerPixel; if (headerCols > rawcols) { pm_message("warning - BytesPerLine = %d, " -Index: netpbm-10.98.2/converter/ppm/picttoppm.c +Index: netpbm-10.96.4/converter/ppm/picttoppm.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/picttoppm.c -+++ netpbm-10.98.2/converter/ppm/picttoppm.c +--- netpbm-10.96.4.orig/converter/ppm/picttoppm.c 2021-12-13 13:11:51.740603358 +0100 ++++ netpbm-10.96.4/converter/ppm/picttoppm.c 2021-12-13 13:17:36.814714167 +0100 @@ -1,3 +1,5 @@ +#error "Unfixable. Don't ship me" + /* * picttoppm.c -- convert a MacIntosh PICT file to PPM format. * -Index: netpbm-10.98.2/converter/ppm/pjtoppm.c +Index: netpbm-10.96.4/converter/ppm/pjtoppm.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/pjtoppm.c -+++ netpbm-10.98.2/converter/ppm/pjtoppm.c +--- netpbm-10.96.4.orig/converter/ppm/pjtoppm.c 2021-12-13 13:11:54.832622323 +0100 ++++ netpbm-10.96.4/converter/ppm/pjtoppm.c 2021-12-13 13:17:36.814714167 +0100 @@ -168,14 +168,20 @@ main(int argc, const char ** argv) { case 'V': /* send plane */ case 'W': /* send last plane */ @@ -663,10 +663,10 @@ Index: netpbm-10.98.2/converter/ppm/pjtoppm.c cols *= 8; } -Index: netpbm-10.98.2/converter/ppm/ppmtoeyuv.c +Index: netpbm-10.96.4/converter/ppm/ppmtoeyuv.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ppmtoeyuv.c -+++ netpbm-10.98.2/converter/ppm/ppmtoeyuv.c +--- netpbm-10.96.4.orig/converter/ppm/ppmtoeyuv.c 2021-12-13 13:11:54.868622544 +0100 ++++ netpbm-10.96.4/converter/ppm/ppmtoeyuv.c 2021-12-13 13:17:36.814714167 +0100 @@ -114,6 +114,7 @@ create_multiplication_tables(const pixva int index; @@ -675,11 +675,11 @@ Index: netpbm-10.98.2/converter/ppm/ppmtoeyuv.c MALLOCARRAY_NOFAIL(mult299 , maxval+1); MALLOCARRAY_NOFAIL(mult587 , maxval+1); MALLOCARRAY_NOFAIL(mult114 , maxval+1); -Index: netpbm-10.98.2/converter/ppm/ppmtoilbm.c +Index: netpbm-10.96.4/converter/ppm/ppmtoilbm.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ppmtoilbm.c -+++ netpbm-10.98.2/converter/ppm/ppmtoilbm.c -@@ -188,6 +188,7 @@ makeValTable(int const oldmaxval, +--- netpbm-10.96.4.orig/converter/ppm/ppmtoilbm.c 2021-12-13 13:11:54.084617737 +0100 ++++ netpbm-10.96.4/converter/ppm/ppmtoilbm.c 2021-12-13 13:17:36.818714191 +0100 +@@ -190,6 +190,7 @@ makeValTable(int const oldmaxval, unsigned int i; int * table; @@ -687,7 +687,7 @@ Index: netpbm-10.98.2/converter/ppm/ppmtoilbm.c MALLOCARRAY_NOFAIL(table, oldmaxval + 1); for (i = 0; i <= oldmaxval; ++i) table[i] = ROUNDDIV(i * newmaxval, oldmaxval); -@@ -1625,6 +1626,7 @@ ppmToRgb8(FILE * const ifP, +@@ -1644,6 +1645,7 @@ ppmToRgb8(FILE * const ifP, maskmethod = 0; /* no masking - RGB8 uses genlock bits */ compmethod = 4; /* RGB8 files are always compressed */ @@ -695,7 +695,7 @@ Index: netpbm-10.98.2/converter/ppm/ppmtoilbm.c MALLOCARRAY_NOFAIL(compr_row, cols * 4); if( maxval != 255 ) { -@@ -1716,6 +1718,7 @@ ppmToRgbn(FILE * const ifP, +@@ -1735,6 +1737,7 @@ ppmToRgbn(FILE * const ifP, maskmethod = 0; /* no masking - RGBN uses genlock bits */ compmethod = 4; /* RGBN files are always compressed */ @@ -703,7 +703,7 @@ Index: netpbm-10.98.2/converter/ppm/ppmtoilbm.c MALLOCARRAY_NOFAIL(compr_row, cols * 2); if( maxval != 15 ) { -@@ -2277,8 +2280,10 @@ main(int argc, char ** argv) { +@@ -2298,8 +2301,10 @@ main(int argc, char ** argv) { MALLOCARRAY_NOFAIL(coded_rowbuf, RowBytes(cols)); for (i = 0; i < RowBytes(cols); ++i) coded_rowbuf[i] = 0; @@ -713,12 +713,12 @@ Index: netpbm-10.98.2/converter/ppm/ppmtoilbm.c pm_rlenc_allocoutbuf(&compr_rowbuf, RowBytes(cols), PM_RLE_PACKBITS); + } } - + switch (mode) { -Index: netpbm-10.98.2/converter/ppm/ppmtolj.c +Index: netpbm-10.96.4/converter/ppm/ppmtolj.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ppmtolj.c -+++ netpbm-10.98.2/converter/ppm/ppmtolj.c +--- netpbm-10.96.4.orig/converter/ppm/ppmtolj.c 2021-12-13 13:11:54.844622398 +0100 ++++ netpbm-10.96.4/converter/ppm/ppmtolj.c 2021-12-13 13:17:36.818714191 +0100 @@ -182,6 +182,7 @@ int main(int argc, char *argv[]) { ppm_readppminit( ifp, &cols, &rows, &maxval, &format ); pixelrow = ppm_allocrow( cols ); @@ -727,10 +727,10 @@ Index: netpbm-10.98.2/converter/ppm/ppmtolj.c obuf = (unsigned char *) pm_allocrow(cols * 3, sizeof(unsigned char)); cbuf = (unsigned char *) pm_allocrow(cols * 6, sizeof(unsigned char)); if (mode == C_TRANS_MODE_DELTA) -Index: netpbm-10.98.2/converter/ppm/ppmtomitsu.c +Index: netpbm-10.96.4/converter/ppm/ppmtomitsu.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ppmtomitsu.c -+++ netpbm-10.98.2/converter/ppm/ppmtomitsu.c +--- netpbm-10.96.4.orig/converter/ppm/ppmtomitsu.c 2021-12-13 13:11:54.844622398 +0100 ++++ netpbm-10.96.4/converter/ppm/ppmtomitsu.c 2021-12-13 13:17:36.818714191 +0100 @@ -685,6 +685,8 @@ main(int argc, char * argv[]) { medias = MSize_User; @@ -740,10 +740,10 @@ Index: netpbm-10.98.2/converter/ppm/ppmtomitsu.c medias.maxcols *= 2; medias.maxrows *= 2; } -Index: netpbm-10.98.2/converter/ppm/ppmtopcx.c +Index: netpbm-10.96.4/converter/ppm/ppmtopcx.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ppmtopcx.c -+++ netpbm-10.98.2/converter/ppm/ppmtopcx.c +--- netpbm-10.96.4.orig/converter/ppm/ppmtopcx.c 2021-12-13 13:11:51.720603235 +0100 ++++ netpbm-10.96.4/converter/ppm/ppmtopcx.c 2021-12-13 13:17:36.818714191 +0100 @@ -410,6 +410,9 @@ writeRaster16Color(FILE * const ofP, unsigned int row; @@ -754,10 +754,10 @@ Index: netpbm-10.98.2/converter/ppm/ppmtopcx.c MALLOCARRAY_NOFAIL(indexRow, cols); MALLOCARRAY(planesrow, bytesPerLine); -Index: netpbm-10.98.2/converter/ppm/ppmtopict.c +Index: netpbm-10.96.4/converter/ppm/ppmtopict.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ppmtopict.c -+++ netpbm-10.98.2/converter/ppm/ppmtopict.c +--- netpbm-10.96.4.orig/converter/ppm/ppmtopict.c 2021-12-13 13:11:54.836622349 +0100 ++++ netpbm-10.96.4/converter/ppm/ppmtopict.c 2021-12-13 13:17:36.818714191 +0100 @@ -450,6 +450,8 @@ main(int argc, const char ** argv) { putShort(stdout, 0); /* mode */ @@ -767,10 +767,10 @@ Index: netpbm-10.98.2/converter/ppm/ppmtopict.c outBuf = malloc((unsigned)(cols+cols/MAX_COUNT+1)); for (row = 0, oc = 0; row < rows; ++row) { unsigned int rowSize; -Index: netpbm-10.98.2/converter/ppm/ppmtopj.c +Index: netpbm-10.96.4/converter/ppm/ppmtopj.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ppmtopj.c -+++ netpbm-10.98.2/converter/ppm/ppmtopj.c +--- netpbm-10.96.4.orig/converter/ppm/ppmtopj.c 2021-12-13 13:11:54.860622495 +0100 ++++ netpbm-10.96.4/converter/ppm/ppmtopj.c 2021-12-13 13:17:36.818714191 +0100 @@ -179,6 +179,7 @@ char *argv[]; pixels = ppm_readppm( ifp, &cols, &rows, &maxval ); @@ -779,10 +779,10 @@ Index: netpbm-10.98.2/converter/ppm/ppmtopj.c obuf = (unsigned char *) pm_allocrow(cols, sizeof(unsigned char)); cbuf = (unsigned char *) pm_allocrow(cols * 2, sizeof(unsigned char)); -Index: netpbm-10.98.2/converter/ppm/ppmtopjxl.c +Index: netpbm-10.96.4/converter/ppm/ppmtopjxl.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ppmtopjxl.c -+++ netpbm-10.98.2/converter/ppm/ppmtopjxl.c +--- netpbm-10.96.4.orig/converter/ppm/ppmtopjxl.c 2021-12-13 13:11:54.836622349 +0100 ++++ netpbm-10.96.4/converter/ppm/ppmtopjxl.c 2021-12-13 13:17:36.818714191 +0100 @@ -266,6 +266,8 @@ main(int argc, const char * argv[]) { pm_error("image too large; reduce with ppmscale"); if (maxval > PCL_MAXVAL) @@ -815,10 +815,10 @@ Index: netpbm-10.98.2/converter/ppm/ppmtopjxl.c inrow = (char *)malloc((unsigned)bpp); outrow = (char *)malloc((unsigned)bpp*2); runcnt = (signed char *)malloc((unsigned)bpp); -Index: netpbm-10.98.2/converter/ppm/ppmtowinicon.c +Index: netpbm-10.96.4/converter/ppm/ppmtowinicon.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ppmtowinicon.c -+++ netpbm-10.98.2/converter/ppm/ppmtowinicon.c +--- netpbm-10.96.4.orig/converter/ppm/ppmtowinicon.c 2021-12-13 13:11:54.836622349 +0100 ++++ netpbm-10.96.4/converter/ppm/ppmtowinicon.c 2021-12-13 13:17:36.818714191 +0100 @@ -12,6 +12,7 @@ #include @@ -862,10 +862,10 @@ Index: netpbm-10.98.2/converter/ppm/ppmtowinicon.c entry->size_in_bytes = xorBitmap->size + andBitmap->size + 40 + (4 * entry->color_count); if (verbose) -Index: netpbm-10.98.2/converter/ppm/ppmtoxpm.c +Index: netpbm-10.96.4/converter/ppm/ppmtoxpm.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ppmtoxpm.c -+++ netpbm-10.98.2/converter/ppm/ppmtoxpm.c +--- netpbm-10.96.4.orig/converter/ppm/ppmtoxpm.c 2021-12-13 13:11:54.836622349 +0100 ++++ netpbm-10.96.4/converter/ppm/ppmtoxpm.c 2021-12-13 13:17:36.818714191 +0100 @@ -198,6 +198,7 @@ genNumstr(unsigned int const input, int unsigned int i; @@ -882,10 +882,10 @@ Index: netpbm-10.98.2/converter/ppm/ppmtoxpm.c MALLOCARRAY(cmap, cmapSize); if (cmapP == NULL) pm_error("Out of memory allocating %u bytes for a color map.", -Index: netpbm-10.98.2/converter/ppm/qrttoppm.c +Index: netpbm-10.96.4/converter/ppm/qrttoppm.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/qrttoppm.c -+++ netpbm-10.98.2/converter/ppm/qrttoppm.c +--- netpbm-10.96.4.orig/converter/ppm/qrttoppm.c 2021-12-13 13:11:54.840622372 +0100 ++++ netpbm-10.96.4/converter/ppm/qrttoppm.c 2021-12-13 13:17:36.818714191 +0100 @@ -46,7 +46,7 @@ main( argc, argv ) ppm_writeppminit( stdout, cols, rows, maxval, 0 ); @@ -895,10 +895,10 @@ Index: netpbm-10.98.2/converter/ppm/qrttoppm.c if ( buf == (unsigned char *) 0 ) pm_error( "out of memory" ); -Index: netpbm-10.98.2/converter/ppm/sldtoppm.c +Index: netpbm-10.96.4/converter/ppm/sldtoppm.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/sldtoppm.c -+++ netpbm-10.98.2/converter/ppm/sldtoppm.c +--- netpbm-10.96.4.orig/converter/ppm/sldtoppm.c 2021-12-13 13:11:54.084617737 +0100 ++++ netpbm-10.96.4/converter/ppm/sldtoppm.c 2021-12-13 13:17:36.818714191 +0100 @@ -506,6 +506,8 @@ slider(slvecfn slvec, /* Allocate image buffer and clear it to black. */ @@ -908,10 +908,10 @@ Index: netpbm-10.98.2/converter/ppm/sldtoppm.c pixels = ppm_allocarray(pixcols = ixdots + 1, pixrows = iydots + 1); PPM_ASSIGN(rgbcolor, 0, 0, 0); ppmd_filledrectangle(pixels, pixcols, pixrows, pixmaxval, 0, 0, -Index: netpbm-10.98.2/converter/ppm/ximtoppm.c +Index: netpbm-10.96.4/converter/ppm/ximtoppm.c =================================================================== ---- netpbm-10.98.2.orig/converter/ppm/ximtoppm.c -+++ netpbm-10.98.2/converter/ppm/ximtoppm.c +--- netpbm-10.96.4.orig/converter/ppm/ximtoppm.c 2021-12-13 13:11:51.712603186 +0100 ++++ netpbm-10.96.4/converter/ppm/ximtoppm.c 2021-12-13 13:17:36.818714191 +0100 @@ -147,6 +147,7 @@ ReadXimHeader(FILE * const in_fp, if (header->nchannels == 3 && header->bits_channel == 8) header->ncolors = 0; @@ -920,10 +920,10 @@ Index: netpbm-10.98.2/converter/ppm/ximtoppm.c header->colors = (Color *)calloc((unsigned int)header->ncolors, sizeof(Color)); if (header->colors == NULL) { -Index: netpbm-10.98.2/editor/pamcut.c +Index: netpbm-10.96.4/editor/pamcut.c =================================================================== ---- netpbm-10.98.2.orig/editor/pamcut.c -+++ netpbm-10.98.2/editor/pamcut.c +--- netpbm-10.96.4.orig/editor/pamcut.c 2021-12-13 13:11:54.872622569 +0100 ++++ netpbm-10.96.4/editor/pamcut.c 2021-12-13 13:17:36.818714191 +0100 @@ -799,6 +799,8 @@ cutOneImage(FILE * const ifP outpam = inpam; /* Initial value -- most fields should be same */ @@ -933,10 +933,10 @@ Index: netpbm-10.98.2/editor/pamcut.c outpam.width = rightcol - leftcol + 1; outpam.height = bottomrow - toprow + 1; -Index: netpbm-10.98.2/editor/pbmreduce.c +Index: netpbm-10.96.4/editor/pbmreduce.c =================================================================== ---- netpbm-10.98.2.orig/editor/pbmreduce.c -+++ netpbm-10.98.2/editor/pbmreduce.c +--- netpbm-10.96.4.orig/editor/pbmreduce.c 2021-12-13 13:11:55.072623795 +0100 ++++ netpbm-10.96.4/editor/pbmreduce.c 2021-12-13 13:17:36.818714191 +0100 @@ -153,6 +153,7 @@ initializeFloydSteinberg(struct FS * co unsigned int col; struct pm_randSt randSt; @@ -945,10 +945,10 @@ Index: netpbm-10.98.2/editor/pbmreduce.c MALLOCARRAY(fsP->thiserr, newcols + 2); MALLOCARRAY(fsP->nexterr, newcols + 2); -Index: netpbm-10.98.2/editor/pnmgamma.c +Index: netpbm-10.96.4/editor/pnmgamma.c =================================================================== ---- netpbm-10.98.2.orig/editor/pnmgamma.c -+++ netpbm-10.98.2/editor/pnmgamma.c +--- netpbm-10.96.4.orig/editor/pnmgamma.c 2021-12-13 13:11:56.088630025 +0100 ++++ netpbm-10.96.4/editor/pnmgamma.c 2021-12-13 13:17:36.818714191 +0100 @@ -596,6 +596,7 @@ createGammaTables(enum transferFunction xelval ** const btableP) { @@ -957,10 +957,10 @@ Index: netpbm-10.98.2/editor/pnmgamma.c MALLOCARRAY(*rtableP, maxval+1); MALLOCARRAY(*gtableP, maxval+1); MALLOCARRAY(*btableP, maxval+1); -Index: netpbm-10.98.2/editor/pnmhisteq.c +Index: netpbm-10.96.4/editor/pnmhisteq.c =================================================================== ---- netpbm-10.98.2.orig/editor/pnmhisteq.c -+++ netpbm-10.98.2/editor/pnmhisteq.c +--- netpbm-10.96.4.orig/editor/pnmhisteq.c 2021-12-13 13:11:56.096630074 +0100 ++++ netpbm-10.96.4/editor/pnmhisteq.c 2021-12-13 13:17:36.818714191 +0100 @@ -107,6 +107,7 @@ computeLuminosityHistogram(xel * const * unsigned int pixelCount; unsigned int * lumahist; @@ -969,10 +969,10 @@ Index: netpbm-10.98.2/editor/pnmhisteq.c MALLOCARRAY(lumahist, maxval + 1); if (lumahist == NULL) pm_error("Out of storage allocating array for %u histogram elements", -Index: netpbm-10.98.2/editor/pnmindex.csh +Index: netpbm-10.96.4/editor/pnmindex.csh =================================================================== ---- netpbm-10.98.2.orig/editor/pnmindex.csh -+++ netpbm-10.98.2/editor/pnmindex.csh +--- netpbm-10.96.4.orig/editor/pnmindex.csh 2021-12-13 13:17:36.802714093 +0100 ++++ netpbm-10.96.4/editor/pnmindex.csh 2021-12-13 13:17:36.818714191 +0100 @@ -1,5 +1,8 @@ #!/bin/csh -f # @@ -982,10 +982,10 @@ Index: netpbm-10.98.2/editor/pnmindex.csh # pnmindex - build a visual index of a bunch of anymaps # # Copyright (C) 1991 by Jef Poskanzer. -Index: netpbm-10.98.2/editor/pnmpad.c +Index: netpbm-10.96.4/editor/pnmpad.c =================================================================== ---- netpbm-10.98.2.orig/editor/pnmpad.c -+++ netpbm-10.98.2/editor/pnmpad.c +--- netpbm-10.96.4.orig/editor/pnmpad.c 2021-12-13 13:11:55.072623795 +0100 ++++ netpbm-10.96.4/editor/pnmpad.c 2021-12-13 13:17:36.818714191 +0100 @@ -654,6 +654,8 @@ main(int argc, const char ** argv) { computePadSizes(cmdline, cols, rows, &lpad, &rpad, &tpad, &bpad); @@ -995,10 +995,10 @@ Index: netpbm-10.98.2/editor/pnmpad.c newcols = cols + lpad + rpad; if (cmdline.reportonly) -Index: netpbm-10.98.2/editor/pnmremap.c +Index: netpbm-10.96.4/editor/pnmremap.c =================================================================== ---- netpbm-10.98.2.orig/editor/pnmremap.c -+++ netpbm-10.98.2/editor/pnmremap.c +--- netpbm-10.96.4.orig/editor/pnmremap.c 2021-12-13 13:11:55.076623820 +0100 ++++ netpbm-10.96.4/editor/pnmremap.c 2021-12-13 13:17:36.818714191 +0100 @@ -469,7 +469,7 @@ fserr_init(struct pam * const pamP, unsigned int plane; @@ -1016,10 +1016,10 @@ Index: netpbm-10.98.2/editor/pnmremap.c for (col = 0; col < pamP->width + 2; ++col) { unsigned int plane; for (plane = 0; plane < pamP->depth; ++plane) -Index: netpbm-10.98.2/editor/pnmscalefixed.c +Index: netpbm-10.96.4/editor/pnmscalefixed.c =================================================================== ---- netpbm-10.98.2.orig/editor/pnmscalefixed.c -+++ netpbm-10.98.2/editor/pnmscalefixed.c +--- netpbm-10.96.4.orig/editor/pnmscalefixed.c 2021-12-13 13:11:56.108630148 +0100 ++++ netpbm-10.96.4/editor/pnmscalefixed.c 2021-12-13 13:17:36.818714191 +0100 @@ -214,6 +214,8 @@ compute_output_dimensions(const struct c const int rows, const int cols, int * newrowsP, int * newcolsP) { @@ -1048,10 +1048,10 @@ Index: netpbm-10.98.2/editor/pnmscalefixed.c sxscale = SCALE * newcols / cols; syscale = SCALE * newrows / rows; -Index: netpbm-10.98.2/editor/pnmshear.c +Index: netpbm-10.96.4/editor/pnmshear.c =================================================================== ---- netpbm-10.98.2.orig/editor/pnmshear.c -+++ netpbm-10.98.2/editor/pnmshear.c +--- netpbm-10.96.4.orig/editor/pnmshear.c 2021-12-13 13:11:56.088630025 +0100 ++++ netpbm-10.96.4/editor/pnmshear.c 2021-12-13 13:17:36.818714191 +0100 @@ -15,6 +15,7 @@ #include #include @@ -1072,10 +1072,10 @@ Index: netpbm-10.98.2/editor/pnmshear.c newcolsD = (double) rows * fabs(shearfac) + cols + 0.999999; if (newcolsD > INT_MAX-2) pm_error("angle is too close to +/-90 degrees; " -Index: netpbm-10.98.2/editor/ppmdither.c +Index: netpbm-10.96.4/editor/ppmdither.c =================================================================== ---- netpbm-10.98.2.orig/editor/ppmdither.c -+++ netpbm-10.98.2/editor/ppmdither.c +--- netpbm-10.96.4.orig/editor/ppmdither.c 2021-12-13 13:11:56.484632454 +0100 ++++ netpbm-10.96.4/editor/ppmdither.c 2021-12-13 13:17:36.818714191 +0100 @@ -355,7 +355,11 @@ dithMatrix(unsigned int const dithPower) unsigned int const dithMatSize = (dithDim * sizeof(*dithMat)) + /* pointers */ @@ -1089,10 +1089,10 @@ Index: netpbm-10.98.2/editor/ppmdither.c dithMat = malloc(dithMatSize); if (dithMat == NULL) -Index: netpbm-10.98.2/editor/specialty/pamoil.c +Index: netpbm-10.96.4/editor/specialty/pamoil.c =================================================================== ---- netpbm-10.98.2.orig/editor/specialty/pamoil.c -+++ netpbm-10.98.2/editor/specialty/pamoil.c +--- netpbm-10.96.4.orig/editor/specialty/pamoil.c 2021-12-13 13:11:56.084630000 +0100 ++++ netpbm-10.96.4/editor/specialty/pamoil.c 2021-12-13 13:17:36.818714191 +0100 @@ -112,6 +112,7 @@ main(int argc, char *argv[] ) { tuples = pnm_readpam(ifp, &inpam, PAM_STRUCT_SIZE(tuple_type)); pm_close(ifp); @@ -1101,10 +1101,10 @@ Index: netpbm-10.98.2/editor/specialty/pamoil.c MALLOCARRAY(hist, inpam.maxval + 1); if (hist == NULL) pm_error("Unable to allocate memory for histogram."); -Index: netpbm-10.98.2/generator/pbmtext.c +Index: netpbm-10.96.4/generator/pbmtext.c =================================================================== ---- netpbm-10.98.2.orig/generator/pbmtext.c -+++ netpbm-10.98.2/generator/pbmtext.c +--- netpbm-10.96.4.orig/generator/pbmtext.c 2021-12-13 13:11:57.516638781 +0100 ++++ netpbm-10.96.4/generator/pbmtext.c 2021-12-13 13:17:36.818714191 +0100 @@ -1144,6 +1144,7 @@ getText(PM_WCHAR const cmdli "Cannot process", lineCount, (unsigned int) MAXLINECHARS); @@ -1121,10 +1121,10 @@ Index: netpbm-10.98.2/generator/pbmtext.c *hmarginP = 2 * fontP->maxwidth; } } -Index: netpbm-10.98.2/generator/pgmkernel.c +Index: netpbm-10.96.4/generator/pgmkernel.c =================================================================== ---- netpbm-10.98.2.orig/generator/pgmkernel.c -+++ netpbm-10.98.2/generator/pgmkernel.c +--- netpbm-10.96.4.orig/generator/pgmkernel.c 2021-12-13 13:11:57.824640671 +0100 ++++ netpbm-10.96.4/generator/pgmkernel.c 2021-12-13 13:17:36.818714191 +0100 @@ -214,6 +214,7 @@ main(int argc, const char * argv[]) { /* Output matrix is symmetric vertically and horizontally. */ @@ -1133,10 +1133,10 @@ Index: netpbm-10.98.2/generator/pgmkernel.c arows = (cmdline.rows + 1) / 2; /* Half the number of rows. Add 1 if odd. */ halfKernel = pgm_allocarray(cmdline.cols, arows); -Index: netpbm-10.98.2/lib/libpammap.c +Index: netpbm-10.96.4/lib/libpammap.c =================================================================== ---- netpbm-10.98.2.orig/lib/libpammap.c -+++ netpbm-10.98.2/lib/libpammap.c +--- netpbm-10.96.4.orig/lib/libpammap.c 2021-12-13 13:11:56.500632552 +0100 ++++ netpbm-10.96.4/lib/libpammap.c 2021-12-13 13:17:36.822714216 +0100 @@ -108,6 +108,8 @@ allocTupleIntListItem(struct pam * const */ struct tupleint_list_item * retval; @@ -1146,10 +1146,10 @@ Index: netpbm-10.98.2/lib/libpammap.c unsigned int const size = sizeof(*retval) - sizeof(retval->tupleint.tuple) + pamP->depth * sizeof(sample); -Index: netpbm-10.98.2/lib/libpbm1.c +Index: netpbm-10.96.4/lib/libpbm1.c =================================================================== ---- netpbm-10.98.2.orig/lib/libpbm1.c -+++ netpbm-10.98.2/lib/libpbm1.c +--- netpbm-10.96.4.orig/lib/libpbm1.c 2021-12-13 13:11:57.504638709 +0100 ++++ netpbm-10.96.4/lib/libpbm1.c 2021-12-13 13:17:36.822714216 +0100 @@ -79,6 +79,7 @@ pbm_check(FILE * const fil } else { pm_filepos const bytesPerRow = (cols+7)/8; @@ -1158,11 +1158,11 @@ Index: netpbm-10.98.2/lib/libpbm1.c pm_check(fileP, checkType, needRasterSize, retvalP); } } -Index: netpbm-10.98.2/lib/libpm.c +Index: netpbm-10.96.4/lib/libpm.c =================================================================== ---- netpbm-10.98.2.orig/lib/libpm.c -+++ netpbm-10.98.2/lib/libpm.c -@@ -892,4 +892,53 @@ pm_parse_height(const char * const arg) +--- netpbm-10.96.4.orig/lib/libpm.c 2021-12-13 13:11:56.496632527 +0100 ++++ netpbm-10.96.4/lib/libpm.c 2021-12-13 13:17:36.822714216 +0100 +@@ -889,4 +889,53 @@ pm_parse_height(const char * const arg) } @@ -1216,11 +1216,11 @@ Index: netpbm-10.98.2/lib/libpm.c + return realloc(a, b*c); +} -Index: netpbm-10.98.2/lib/pm.h +Index: netpbm-10.96.4/lib/pm.h =================================================================== ---- netpbm-10.98.2.orig/lib/pm.h -+++ netpbm-10.98.2/lib/pm.h -@@ -445,4 +445,11 @@ pm_parse_height(const char * const arg); +--- netpbm-10.96.4.orig/lib/pm.h 2021-12-13 13:11:56.508632602 +0100 ++++ netpbm-10.96.4/lib/pm.h 2021-12-13 13:17:36.822714216 +0100 +@@ -442,4 +442,11 @@ pm_parse_height(const char * const arg); #endif @@ -1232,10 +1232,10 @@ Index: netpbm-10.98.2/lib/pm.h +void overflow_add(int, int); + #endif -Index: netpbm-10.98.2/other/pnmcolormap.c +Index: netpbm-10.96.4/other/pnmcolormap.c =================================================================== ---- netpbm-10.98.2.orig/other/pnmcolormap.c -+++ netpbm-10.98.2/other/pnmcolormap.c +--- netpbm-10.96.4.orig/other/pnmcolormap.c 2021-12-13 13:12:01.568663631 +0100 ++++ netpbm-10.96.4/other/pnmcolormap.c 2021-12-13 13:17:36.822714216 +0100 @@ -1002,6 +1002,7 @@ colormapToSquare(struct pam * const pamP pamP->width = intsqrt; else @@ -1244,10 +1244,23 @@ Index: netpbm-10.98.2/other/pnmcolormap.c } { unsigned int const intQuotient = colormap.size / pamP->width; -Index: netpbm-10.98.2/urt/rle_addhist.c +Index: netpbm-10.96.4/urt/README =================================================================== ---- netpbm-10.98.2.orig/urt/rle_addhist.c -+++ netpbm-10.98.2/urt/rle_addhist.c +--- netpbm-10.96.4.orig/urt/README 2021-12-13 13:12:01.848665347 +0100 ++++ netpbm-10.96.4/urt/README 2021-12-13 13:17:36.822714216 +0100 +@@ -18,3 +18,8 @@ in its initializer in the original. But + defines stdout as a variable, so that wouldn't compile. So I changed + it to NULL and added a line to rle_hdr_init to set that field to + 'stdout' dynamically. 2000.06.02 BJH. ++ ++Redid the code to check for maths overflows and other crawly horrors. ++Removed pipe through and compress support (unsafe) ++ ++Alan Cox +Index: netpbm-10.96.4/urt/rle_addhist.c +=================================================================== +--- netpbm-10.96.4.orig/urt/rle_addhist.c 2021-12-13 13:12:01.848665347 +0100 ++++ netpbm-10.96.4/urt/rle_addhist.c 2021-12-13 13:17:36.822714216 +0100 @@ -14,6 +14,8 @@ * If you modify this software, you should include a notice giving the * name of the person performing the modification, the date of modification, @@ -1255,11 +1268,11 @@ Index: netpbm-10.98.2/urt/rle_addhist.c + * + * 2002-12-19: Fix maths wrapping bugs. Alan Cox */ - /* + /* * rle_addhist.c - Add to the HISTORY comment in header @@ -70,13 +72,19 @@ rle_addhist(char * argv[], return; - + length = 0; - for (i = 0; argv[i]; ++i) + for (i = 0; argv[i]; ++i) { @@ -1281,7 +1294,7 @@ Index: netpbm-10.98.2/urt/rle_addhist.c @@ -84,9 +92,12 @@ rle_addhist(char * argv[], else old = NULL; - + - if (old && *old) + if (old && *old) { + overflow_add(length, strlen(old)); @@ -1292,10 +1305,10 @@ Index: netpbm-10.98.2/urt/rle_addhist.c ++length; /*Cater for the null. */ MALLOCARRAY(newc, length); -Index: netpbm-10.98.2/urt/rle_getrow.c +Index: netpbm-10.96.4/urt/rle_getrow.c =================================================================== ---- netpbm-10.98.2.orig/urt/rle_getrow.c -+++ netpbm-10.98.2/urt/rle_getrow.c +--- netpbm-10.96.4.orig/urt/rle_getrow.c 2021-12-13 13:12:01.556663557 +0100 ++++ netpbm-10.96.4/urt/rle_getrow.c 2021-12-13 13:17:36.822714216 +0100 @@ -17,6 +17,8 @@ * * Modified at BRL 16-May-88 by Mike Muuss to avoid Alliant STDC desire @@ -1303,7 +1316,7 @@ Index: netpbm-10.98.2/urt/rle_getrow.c + * + * 2002-12-19: Fix maths wrapping bugs. Alan Cox */ - /* + /* * rle_getrow.c - Read an RLE file in. @@ -164,6 +166,7 @@ rle_get_setup(rle_hdr * const the_hdr) { char * cp; @@ -1313,10 +1326,10 @@ Index: netpbm-10.98.2/urt/rle_getrow.c evenlen = (comlen + 1) & ~1; /* make it even */ if (evenlen) { MALLOCARRAY(comment_buf, evenlen); -Index: netpbm-10.98.2/urt/rle_hdr.c +Index: netpbm-10.96.4/urt/rle_hdr.c =================================================================== ---- netpbm-10.98.2.orig/urt/rle_hdr.c -+++ netpbm-10.98.2/urt/rle_hdr.c +--- netpbm-10.96.4.orig/urt/rle_hdr.c 2021-12-13 13:12:01.848665347 +0100 ++++ netpbm-10.96.4/urt/rle_hdr.c 2021-12-13 13:17:36.822714216 +0100 @@ -14,6 +14,8 @@ * If you modify this software, you should include a notice giving the * name of the person performing the modification, the date of modification, @@ -1352,10 +1365,10 @@ Index: netpbm-10.98.2/urt/rle_hdr.c size *= sizeof(char *); toHdrP->comments = malloc(size); if (!toHdrP->comments) -Index: netpbm-10.98.2/urt/rle.h +Index: netpbm-10.96.4/urt/rle.h =================================================================== ---- netpbm-10.98.2.orig/urt/rle.h -+++ netpbm-10.98.2/urt/rle.h +--- netpbm-10.96.4.orig/urt/rle.h 2021-12-13 13:12:01.856665397 +0100 ++++ netpbm-10.96.4/urt/rle.h 2021-12-13 13:17:36.822714216 +0100 @@ -14,6 +14,9 @@ * If you modify this software, you should include a notice giving the * name of the person performing the modification, the date of modification, @@ -1384,10 +1397,10 @@ Index: netpbm-10.98.2/urt/rle.h /* Declare RLE library routines. */ -Index: netpbm-10.98.2/urt/rle_open_f.c +Index: netpbm-10.96.4/urt/rle_open_f.c =================================================================== ---- netpbm-10.98.2.orig/urt/rle_open_f.c -+++ netpbm-10.98.2/urt/rle_open_f.c +--- netpbm-10.96.4.orig/urt/rle_open_f.c 2021-12-13 13:12:01.388662528 +0100 ++++ netpbm-10.96.4/urt/rle_open_f.c 2021-12-13 13:17:36.822714216 +0100 @@ -163,65 +163,7 @@ dealWithSubprocess(const char * const f FILE ** const fpP, bool * const noSubprocessP, @@ -1454,10 +1467,10 @@ Index: netpbm-10.98.2/urt/rle_open_f.c } -Index: netpbm-10.98.2/urt/rle_putcom.c +Index: netpbm-10.96.4/urt/rle_putcom.c =================================================================== ---- netpbm-10.98.2.orig/urt/rle_putcom.c -+++ netpbm-10.98.2/urt/rle_putcom.c +--- netpbm-10.96.4.orig/urt/rle_putcom.c 2021-12-13 13:12:01.852665372 +0100 ++++ netpbm-10.96.4/urt/rle_putcom.c 2021-12-13 13:17:36.822714216 +0100 @@ -14,6 +14,8 @@ * If you modify this software, you should include a notice giving the * name of the person performing the modification, the date of modification, @@ -1465,7 +1478,7 @@ Index: netpbm-10.98.2/urt/rle_putcom.c + * + * 2002-12-19: Fix maths wrapping bugs. Alan Cox */ - /* + /* * rle_putcom.c - Add a picture comment to the header struct. @@ -98,12 +100,14 @@ rle_putcom(const char * const value, const char * v; @@ -1483,10 +1496,10 @@ Index: netpbm-10.98.2/urt/rle_putcom.c /* Not found */ /* Can't realloc because somebody else might be pointing to this * comments block. Of course, if this were true, then the -Index: netpbm-10.98.2/urt/Runput.c +Index: netpbm-10.96.4/urt/Runput.c =================================================================== ---- netpbm-10.98.2.orig/urt/Runput.c -+++ netpbm-10.98.2/urt/Runput.c +--- netpbm-10.96.4.orig/urt/Runput.c 2021-12-13 13:12:01.852665372 +0100 ++++ netpbm-10.96.4/urt/Runput.c 2021-12-13 13:17:36.822714216 +0100 @@ -17,6 +17,8 @@ * * Modified at BRL 16-May-88 by Mike Muuss to avoid Alliant STDC desire @@ -1494,35 +1507,60 @@ Index: netpbm-10.98.2/urt/Runput.c + * + * 2002-12-19: Fix maths wrapping bugs. Alan Cox */ - /* + /* * Runput.c - General purpose Run Length Encoding. -@@ -202,9 +204,10 @@ RunSetup(rle_hdr * the_hdr) +@@ -202,9 +204,11 @@ RunSetup(rle_hdr * the_hdr) if ( the_hdr->background != 0 ) { - int i; -- rle_pixel *background = -- (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); -+ rle_pixel *background; - int *bg_color; -+ overflow_add(the_hdr->ncolors,1); -+ background = (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); - /* - * If even number of bg color bytes, put out one more to get to - * 16 bit boundary. -@@ -224,7 +227,7 @@ RunSetup(rle_hdr * the_hdr) - /* Big-endian machines are harder */ - int i, nmap = (1 << the_hdr->cmaplen) * - the_hdr->ncmap; -- char *h_cmap = (char *)malloc( nmap * 2 ); -+ char *h_cmap = (char *)malloc2( nmap, 2 ); - if ( h_cmap == NULL ) - { - fprintf( stderr, -Index: netpbm-10.98.2/lib/libpam.c + register int i; +- register rle_pixel *background = +- (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); ++ register rle_pixel *background; + register int *bg_color; ++ ++ overflow_add(the_hdr->ncolors,1); ++ background = (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); + /* + * If even number of bg color bytes, put out one more to get to + * 16 bit boundary. +@@ -224,7 +228,7 @@ RunSetup(rle_hdr * the_hdr) + /* Big-endian machines are harder */ + register int i, nmap = (1 << the_hdr->cmaplen) * + the_hdr->ncmap; +- register char *h_cmap = (char *)malloc( nmap * 2 ); ++ register char *h_cmap = (char *)malloc2( nmap, 2 ); + if ( h_cmap == NULL ) + { + fprintf( stderr, +Index: netpbm-10.96.4/urt/scanargs.c =================================================================== ---- netpbm-10.98.2.orig/lib/libpam.c -+++ netpbm-10.98.2/lib/libpam.c -@@ -230,7 +230,8 @@ allocPamRow(const struct pam * const pam +--- netpbm-10.96.4.orig/urt/scanargs.c 2021-12-13 13:12:01.852665372 +0100 ++++ netpbm-10.96.4/urt/scanargs.c 2021-12-13 13:17:36.822714216 +0100 +@@ -38,6 +38,8 @@ + * + * Modified at BRL 16-May-88 by Mike Muuss to avoid Alliant STDC desire + * to have all "void" functions so declared. ++ * ++ * 2002-12-19: Fix maths wrapping bugs. Alan Cox + */ + + #include +@@ -62,8 +64,8 @@ typedef int *ptr; + /* + * Storage allocation macros + */ +-#define NEW( type, cnt ) (type *) malloc( (cnt) * sizeof( type ) ) +-#define RENEW( type, ptr, cnt ) (type *) realloc( ptr, (cnt) * sizeof( type ) ) ++#define NEW( type, cnt ) (type *) malloc2( (cnt) , sizeof( type ) ) ++#define RENEW( type, ptr, cnt ) (type *) realloc2( ptr, (cnt), sizeof( type ) ) + + static CONST_DECL char * prformat( CONST_DECL char *, int ); + static int isnum( CONST_DECL char *, int, int ); +Index: netpbm-10.96.4/lib/libpam.c +=================================================================== +--- netpbm-10.96.4.orig/lib/libpam.c 2021-12-13 13:11:56.116630197 +0100 ++++ netpbm-10.96.4/lib/libpam.c 2021-12-13 13:17:36.822714216 +0100 +@@ -225,7 +225,8 @@ allocPamRow(const struct pam * const pam unsigned int const bytesPerTuple = allocationDepth(pamP) * sizeof(sample); tuple * tuplerow; diff --git a/netpbm-security-scripts.patch b/netpbm-security-scripts.patch index 4937d9f..ada860a 100644 --- a/netpbm-security-scripts.patch +++ b/netpbm-security-scripts.patch @@ -1,135 +1,274 @@ -Index: netpbm-10.98.2/editor/ppmfade +Index: netpbm-10.93.0/editor/ppmfade =================================================================== ---- netpbm-10.98.2.orig/editor/ppmfade -+++ netpbm-10.98.2/editor/ppmfade +--- netpbm-10.93.0.orig/editor/ppmfade 2020-12-29 11:04:15.768844529 +0100 ++++ netpbm-10.93.0/editor/ppmfade 2020-12-29 11:06:05.909522666 +0100 @@ -40,6 +40,7 @@ exec perl -w -x -S -- "$0" "$@" # ############################################################################## use strict; +use File::Temp "tempdir"; - use File::Temp; + sub doVersionHack($) { + my ($argvR) = @_; +@@ -149,20 +150,26 @@ if ($first_file ne "undefined") { -@@ -212,84 +213,84 @@ for ($i = 1; $i <= $nframes; $i++) { + print("Frames are " . $width . "W x " . $height . "H\n"); + ++# ++# We create a tmp-directory right here ++# ++my $tmpdir = tempdir("ppmfade.XXXXXX", CLEANUP => 1); ++ ++ + if ($first_file eq "undefined") { + print "Fading from black to "; +- system("ppmmake \\#000 $width $height >junk1$$.ppm"); ++ system("ppmmake \\#000 $width $height >$tmpdir/junk1$$.ppm"); + } else { + print "Fading from $first_file to "; +- system("cp", $first_file, "junk1$$.ppm"); ++ system("cp", $first_file, "$tmpdir/junk1$$.ppm"); + } + + if ($last_file eq "undefined") { + print "black.\n"; +- system("ppmmake \\#000 $width $height >junk2$$.ppm"); ++ system("ppmmake \\#000 $width $height >$tmpdir/junk2$$.ppm"); + } else { + print "$last_file\n"; +- system("cp", $last_file, "junk2$$.ppm"); ++ system("cp", $last_file, "$tmpdir/junk2$$.ppm"); + } + + # +@@ -170,14 +177,14 @@ if ($last_file eq "undefined") { + # + + # Here's what our temporary files are: +-# junk1$$.ppm: The original (fade-from) image +-# junk2$$.ppm: The target (fade-from) image +-# junk3$$.ppm: The frame of the fade for the current iteration of the +-# the for loop. +-# junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate +-# image to another, this is the first frame of that +-# sequence. +-# junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence ++# $tmpdir/junk1$$.ppm: The original (fade-from) image ++# $tmpdir/junk2$$.ppm: The target (fade-from) image ++# $tmpdir/junk3$$.ppm: The frame of the fade for the current iteration of the ++# the for loop. ++# $tmpdir/junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate ++# image to another, this is the first frame of that ++# sequence. ++# $tmpdir/junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence + + my $i; # Frame number + for ($i = 1; $i <= $nframes; $i++) { +@@ -185,147 +192,147 @@ for ($i = 1; $i <= $nframes; $i++) { + if ($mode eq $SPREAD) { + if ($i <= 10) { + my $n = $spline20[$i] * 100; +- system("ppmspread $n junk1$$.ppm >junk3$$.ppm"); ++ system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm"); + } elsif ($i <= 20) { + my $n; $n = $spline20[$i] * 100; - system("ppmshift $n $tmpdir/junk1.ppm >$tmpdir/junk1a.ppm"); - $n = (1-$spline20[$i-10])*100; -- system("ppmshift $n junk2.ppm >junk2a.ppm"); -+ system("ppmshift $n $tmpdir/junk2.ppm > $tmpdir/junk2a.ppm"); +- system("ppmspread $n junk1$$.ppm >junk1a$$.ppm"); ++ system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk1a$$.ppm"); + $n = (1-$spline20[$i-10]) * 100; +- system("ppmspread $n junk2$$.ppm >junk2a$$.ppm"); ++ system("ppmspread $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm"); $n = $spline10[$i-10]; -- system("ppmmix $n junk1a.ppm junk2a.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk1a.ppm $tmpdir/junk2a.ppm > $tmpdir/junk3.ppm"); +- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm"); + } else { + my $n = (1-$spline20[$i-10])*100; +- system("ppmspread $n junk2$$.ppm >junk3$$.ppm"); ++ system("ppmspread $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); + } + } elsif ($mode eq $SHIFT) { + if ($i <= 10) { + my $n = $spline20[$i] * 100; +- system("ppmshift $n junk1$$.ppm >junk3$$.ppm"); ++ system("ppmshift $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm"); + } elsif ($i <= 20) { + my $n; + $n = $spline20[$i] * 100; +- system("ppmshift $n junk1$$.ppm >junk1a$$.ppm"); ++ system("ppmshift $n $tmpdir/junk1$$.ppm >$tmpdir/junk1a$$.ppm"); + $n = (1-$spline20[$i-10])*100; +- system("ppmshift $n junk2$$.ppm >junk2a$$.ppm"); ++ system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm"); + $n = $spline10[$i-10]; +- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm"); } else { my $n = (1-$spline20[$i-10]) * 100; -- system("ppmshift $n junk2.ppm >junk3.ppm"); -+ system("ppmshift $n $tmpdir/junk2.ppm > $tmpdir/junk3.ppm"); +- system("ppmshift $n junk2$$.ppm >junk3$$.ppm"); ++ system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); } } elsif ($mode eq $RELIEF) { if ($i == 1) { -- system("ppmrelief junk1.ppm >junk1r.ppm"); -+ system("ppmrelief $tmpdir/junk1.ppm >$tmpdir/junk1r.ppm"); +- system("ppmrelief junk1$$.ppm >junk1r$$.ppm"); ++ system("ppmrelief $tmpdir/junk1$$.ppm >$tmpdir/junk1r$$.ppm"); } if ($i <= 10) { my $n = $spline10[$i]; -- system("ppmmix $n junk1.ppm junk1r.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk1.ppm $tmpdir/junk1r.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk1$$.ppm junk1r$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1r$$.ppm >$tmpdir/junk3$$.ppm"); } elsif ($i <= 20) { my $n = $spline10[$i-10]; -- system("ppmmix $n junk1r.ppm junk2r.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk1r.ppm $tmpdir/junk2r.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk1r$$.ppm junk2r$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1r$$.ppm $tmpdir/junk2r$$.ppm >$tmpdir/junk3$$.ppm"); } else { my $n = $spline10[$i-20]; -- system("ppmmix $n junk2r.ppm junk2.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk2r.ppm $tmpdir/junk2.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk2r$$.ppm junk2$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk2r$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); } if ($i == 10) { -- system("ppmrelief junk2.ppm >junk2r.ppm"); -+ system("ppmrelief $tmpdir/junk2.ppm >$tmpdir/junk2r.ppm"); +- system("ppmrelief junk2$$.ppm >junk2r$$.ppm"); ++ system("ppmrelief $tmpdir/junk2$$.ppm >$tmpdir/junk2r$$.ppm"); } } elsif ($mode eq $OIL) { if ($i == 1) { -- system("ppmtopgm junk1.ppm | pgmoil >junko.ppm"); -- system("rgb3toppm junko.ppm junko.ppm junko.ppm " . -- ">junk1o.ppm"); -+ system("ppmtopgm $tmpdir/junk1.ppm | pgmoil >$tmpdir/junko.ppm"); -+ system("rgb3toppm $tmpdir/junko.ppm $tmpdir/junko.ppm $tmpdir/junko.ppm " . -+ ">$tmpdir/junk1o.ppm"); +- system("ppmtopgm junk1$$.ppm | pgmoil >junko$$.ppm"); +- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . +- ">junk1o$$.ppm"); ++ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmoil >$tmpdir/junko$$.ppm"); ++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . ++ ">$tmpdir/junk1o$$.ppm"); } if ($i <= 10) { my $n = $spline10[$i]; -- system("ppmmix $n junk1.ppm junk1o.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk1.ppm $tmpdir/junk1o.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm"); } elsif ($i <= 20) { my $n = $spline10[$i-10]; -- system("ppmmix $n junk1o.ppm junk2o.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk1o.ppm $tmpdir/junk2o.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm"); } else { my $n = $spline10[$i-20]; -- system("ppmmix $n junk2o.ppm junk2.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk2o.ppm $tmpdir/junk2.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); } if ($i == 10) { -- system("ppmtopgm junk2.ppm | pgmoil >junko.ppm"); -- system("rgb3toppm junko.ppm junko.ppm junko.ppm " . -- ">junk2o.ppm"); -+ system("ppmtopgm $tmpdir/junk2.ppm | pgmoil >$tmpdir/junko.ppm"); -+ system("rgb3toppm $tmpdir/junko.ppm $tmpdir/junko.ppm $tmpdir/junko.ppm " . -+ ">$tmpdir/junk2o.ppm"); +- system("ppmtopgm junk2$$.ppm | pgmoil >junko$$.ppm"); +- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . +- ">junk2o$$.ppm"); ++ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmoil >$tmpdir/junko$$.ppm"); ++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . ++ ">$tmpdir/junk2o$$.ppm"); } } elsif ($mode eq $EDGE) { if ($i == 1) { -- system("ppmtopgm junk1.ppm | pgmedge >junko.ppm"); -- system("rgb3toppm junko.ppm junko.ppm junko.ppm " . -- ">junk1o.ppm"); -+ system("ppmtopgm $tmpdir/junk1.ppm | pgmedge >$tmpdir/junko.ppm"); -+ system("rgb3toppm $tmpdir/junko.ppm $tmpdir/junko.ppm $tmpdir/junko.ppm " . -+ ">$tmpdir/junk1o.ppm"); +- system("ppmtopgm junk1$$.ppm | pgmedge >junko$$.ppm"); +- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . +- ">junk1o$$.ppm"); ++ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmedge >$tmpdir/junko$$.ppm"); ++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . ++ ">$tmpdir/junk1o$$.ppm"); } if ($i <= 10) { my $n = $spline10[$i]; -- system("ppmmix $n junk1.ppm junk1o.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk1.ppm $tmpdir/junk1o.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm"); } elsif ($i <= 20) { my $n = $spline10[$i-10]; -- system("ppmmix $n junk1o.ppm junk2o.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk1o.ppm $tmpdir/junk2o.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm"); } else { my $n = $spline10[$i-20]; -- system("ppmmix $n junk2o.ppm junk2.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk2o.ppm $tmpdir/junk2.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); } if ($i == 10) { -- system("ppmtopgm junk2.ppm | pgmedge >junko.ppm"); -- system("rgb3toppm junko.ppm junko.ppm junko.ppm " . -- ">junk2o.ppm"); -+ system("ppmtopgm $tmpdir/junk2.ppm | pgmedge >$tmpdir/junko.ppm"); -+ system("rgb3toppm $tmpdir/junko.ppm $tmpdir/junko.ppm $tmpdir/junko.ppm " . -+ ">$tmpdir/junk2o.ppm"); +- system("ppmtopgm junk2$$.ppm | pgmedge >junko$$.ppm"); +- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . +- ">junk2o$$.ppm"); ++ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmedge >$tmpdir/junko$$.ppm"); ++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . ++ ">$tmpdir/junk2o$$.ppm"); } } elsif ($mode eq $BENTLEY) { if ($i == 1) { -- system("ppmtopgm junk1.ppm | pgmbentley >junko.ppm"); -- system("rgb3toppm junko.ppm junko.ppm junko.ppm " . -- ">junk1o.ppm"); -+ system("ppmtopgm $tmpdir/junk1.ppm | pgmbentley >$tmpdir/junko.ppm"); -+ system("rgb3toppm $tmpdir/junko.ppm $tmpdir/junko.ppm $tmpdir/junko.ppm " . -+ ">$tmpdir/junk1o.ppm"); +- system("ppmtopgm junk1$$.ppm | pgmbentley >junko$$.ppm"); +- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . +- ">junk1o$$.ppm"); ++ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmbentley >$tmpdir/junko$$.ppm"); ++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . ++ ">$tmpdir/junk1o$$.ppm"); } if ($i <= 10) { my $n = $spline10[$i]; -- system("ppmmix $n junk1.ppm junk1o.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk1.ppm $tmpdir/junk1o.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm"); } elsif ($i <= 20) { my $n = $spline10[$i-10]; -- system("ppmmix $n junk1o.ppm junk2o.ppm >junk3.ppm"); -+ system("ppmmix $n $tmpdir/junk1o.ppm $tmpdir/junk2o.ppm >$tmpdir/junk3.ppm"); +- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm"); } else { my $n = $spline10[$i-20]; - system("ppmmix $n $tmpdir/junk2o.ppm $tmpdir/junk2.ppm " . -Index: netpbm-10.98.2/editor/ppmshadow +- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); + } + if ($i == 10) { +- system("ppmtopgm junk2$$.ppm | pgmbentley >junko$$.ppm"); +- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . +- ">junk2o$$.ppm"); ++ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmbentley >$tmpdir/junko$$.ppm"); ++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . ++ ">$tmpdir/junk2o$$.ppm"); + } + } elsif ($mode eq $BLOCK) { + if ($i <= 10) { + my $n = 1 - 1.9*$spline20[$i]; +- system("pamscale $n junk1$$.ppm | " . +- "pamscale -width $width -height $height >junk3$$.ppm"); ++ system("pamscale $n $tmpdir/junk1$$.ppm | " . ++ "pamscale -width $width -height $height >$tmpdir/junk3$$.ppm"); + } elsif ($i <= 20) { + my $n = $spline10[$i-10]; +- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm"); ++ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm"); + } else { + my $n = 1 - 1.9*$spline20[31-$i]; +- system("pamscale $n junk2$$.ppm | " . +- "pamscale -width $width -height $height >junk3$$.ppm"); ++ system("pamscale $n $tmpdir/junk2$$.ppm | " . ++ "pamscale -width $width -height $height >$tmpdir/junk3$$.ppm"); + } + if ($i == 10) { +- system("cp", "junk3$$.ppm", "junk1a$$.ppm"); +- system("pamscale $n junk2$$.ppm | " . +- "pamscale -width $width -height $height >junk2a$$.ppm"); ++ system("cp", "$tmpdir/junk3$$.ppm", "$tmpdir/junk1a$$.ppm"); ++ system("pamscale $n $tmpdir/junk2$$.ppm | " . ++ "pamscale -width $width -height $height >$tmpdir/junk2a$$.ppm"); + } + } elsif ($mode eq $MIX) { + my $fade_factor = sqrt(1/($nframes-$i+1)); +- system("ppmmix $fade_factor junk1$$.ppm junk2$$.ppm >junk3$$.ppm"); ++ system("ppmmix $fade_factor $tmpdir/junk1$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); + } else { + print("Internal error: impossible mode value '$mode'\n"); + } + + my $outfile = sprintf("%s.%04d.ppm", $base_name, $i); +- system("cp", "junk3$$.ppm", $outfile); ++ system("cp", "$tmpdir/junk3$$.ppm", $outfile); + } + + # + # Clean up shop. + # +-system("rm junk*$$.ppm"); ++system("rm $tmpdir/junk*$$.ppm"); + + exit(0); +Index: netpbm-10.93.0/editor/ppmshadow =================================================================== ---- netpbm-10.98.2.orig/editor/ppmshadow -+++ netpbm-10.98.2/editor/ppmshadow +--- netpbm-10.93.0.orig/editor/ppmshadow 2020-12-29 11:04:15.768844529 +0100 ++++ netpbm-10.93.0/editor/ppmshadow 2020-12-29 11:06:05.909522666 +0100 @@ -194,9 +194,10 @@ my $tmpdir = $ENV{TMPDIR} || "/tmp"; my $ourtmp; @@ -142,5 +281,5 @@ Index: netpbm-10.98.2/editor/ppmshadow + die "Can't create directory for temporary files"; + } } else { - $ourtmp = File::Temp::tempdir("$tmpdir/ppmshadowXXXX", CLEANUP=>1); + $ourtmp = File::Temp::tempdir("$tmpdir/ppmshadowXXXX", UNLINK=>1); } diff --git a/netpbm.changes b/netpbm.changes index 9840efe..edc492b 100644 --- a/netpbm.changes +++ b/netpbm.changes @@ -1,133 +1,3 @@ -------------------------------------------------------------------- -Mon May 30 14:55:07 UTC 2022 - pgajdos@suse.com - -- version update to 10.98.2 - palmtopnm: Fix failure with bogus claim of invalid input on - architectures that do not use two's complement negative numbers. - Always broken. (Ability to convert PackBits input was new in - Netpbm 10.27 (March 2005). - - pnmgamma -srgbtobt709, -bt709tosrgb: fix bug; incorrect output. - Always broken (These options were new in Netpbm 10.32 (February - 2006)). Thanks Alexander Shpilkin . - - pamdice: Fix incorrect output file name with PAM input. Always - broken (pamdice was new in Netpbm 9.25 (March 2002). - - - pamtopdbimg: Add -fixedtime. - - ppmfade: Use temporary files securely. - - pnmtosir: Set some possibly meaningless bits in output to zero - so output is repeatable. - - pamx: Fix bug: top-justifies image in all cases where it should - bottom-justify. Always broken. (pamx was new in Netpbm 10.34 - (June 2006). - - pnmtorle: Fix bug: -h works only on first image. - - pamsistoaglyph: Fix invalid memory reference and incorrect - output on depth 1 input. Always broken. (pamsistoaglyph was - new in Netpbm 10.47 (June 2009). Thanks Scott Pakin. - - - pambayer: Fix bogus colors at edges. Always Broken (pambayer - was new in Release 10.30 (October 2005)). - - libnetpbm, various programs: fix bug: bogus warning that a color - specified on command line cannot be represented exactly with the - maxval being used. Introduced in Netpbm 10.83 (June 2018). - - pnmtopsnr: Fix typo in error message. Always broken (pnmpsnr - was new in Netpbm 9.6 (July 2000). - - ppmtoilbm: Remove -floyd (aka -fs) option, which hasn't worked - in a long time if ever and is inappropriate function for this - program. And the broken code is inconsistent with new random - number logic elsewhere in the package. - - ppmtoapplevol: Fix bug: reads from Standard Input even when you - specify the input file argument. Always broken. (ppmtoapplevol - was new in Netpbm 10.54 (March 2011). - - ppmtoapplevol: Fix bug: produces garbage with input image wider - than 255. Always broken. (ppmtoapplevol was new in Netpbm - 10.54 (March 2011). - - pgmmedian: fix crash when median matrix is wider or higher than - the input image. - - picttoppm: Fix incorrect output for 32 bit per pixel images - that have only 3 planes. Broken in Netpbm 10.34 (June 2006). - - pamendian: fix bogus "sample exceeds maxval" failure. - Introduced in Netpbm 10.66 (March 2014). - - ppmtoilbm: Fix wild memory references and hangs with -map . - Introduced in Netpbm 9.12 (March 2001). - - pgmtexture: Fix incorrect output. Always broken. (Program was - added in primordial Netpbm in 1991). - - pgmabel: Fix incorrect output. Always broken. (Program was - new in Netpbm 10.3 (July 2002). - - Remove Floyd-Steinberg dithering functions (ppm_fs_*) from - libnetpbm (libppmfloyd). No longer used. Floyd-Steinberg - dithering logic can be found in pnmremap. libppmfloyd - was previously used by ppmtoilbm. - - Add pbnnoise. - - pnmpad: Use -halign with -mwidth and default to centering the - image instead of left-justifying when no other padding is being - added. Same with -mheight, -valign, and top-justifying. - - xwdtopnm: Add ability to process bit depth 32. - - pgmtoppm: Add -black, -white. - - ppmpat: Add -mesh. - - pampaintspill: Add -near. Thanks Scott Pakin. - - pamtogif: Fix bug: doesn't ignore the input alpha mask when user - specified -transparent. Broken in Netpbm 10.37 (December 2006). - - palmtopnm: Fix bug: fails with PackBits input on platform with - default unsigned char, such as ppc64. Always broken. (Ability - to convert PackBits input was new in Netpbm 10.27 (March 2005). - - pamrubber: Fix bug: random behavior with -quad when you specify - both points for source or target and the second one is lower in - the image than the first. Always broken (Pamrubber was new in - Netpbm 10.54 (March 2011)). - - sunicontopnm, escp2topbm, mgrtopbm, ybmtopbm, pamcut, pbmpscale, - pnmcat, pnmpad: Fix arithmetic overrun with ridiculously large - image. - - pbmclean: Fix overallocation of memory (waste). - - libnetbm: Add pnm_writepamrowpart, pnm_formatPamtuples. - - libnetpbm: When validating computable size of width and height, - allow for adding up to 10 instead of 2, to account for rounding - up to a multiple of 8 in processing bit maps. - - Build: Don't attempt to build 'pamexec' on systems without - Unix process management. Bug introduced in Netpbm 10.94 - (March 2021) and supposedly fixed in 10.95, but not really. - -- modified patches - % netpbm-security-code.patch (refreshed) - % netpbm-security-scripts.patch (refreshed) -- deleted patches - - signed-char.patch (upstreamed) - - big-endian.patch (upstreamed) - ------------------------------------------------------------------- Sun Dec 19 17:47:53 UTC 2021 - Andreas Schwab diff --git a/netpbm.spec b/netpbm.spec index 402a090..606e889 100644 --- a/netpbm.spec +++ b/netpbm.spec @@ -1,7 +1,7 @@ # # spec file for package netpbm # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,10 +20,10 @@ %define asan_build 0 %define ubsan_build 0 %define libmaj 11 -%define libmin 98 +%define libmin 96 %define libver %{libmaj}.%{libmin} Name: netpbm -Version: 10.98.2 +Version: 10.96.4 Release: 0 Summary: A Graphics Conversion Package License: BSD-3-Clause AND GPL-2.0-or-later AND IJG AND MIT AND SUSE-Public-Domain @@ -37,10 +37,14 @@ Source3: prepare-src-tarball.sh Patch0: %{name}-make.patch # neccessary for running with ASAN Patch1: %{name}-tmpfile.patch -#Patch2: %{name}-security-code.patch -#Patch3: %{name}-security-scripts.patch -#Patch4: %{name}-gcc-warnings.patch +Patch2: %{name}-security-code.patch +Patch3: %{name}-security-scripts.patch +Patch4: %{name}-gcc-warnings.patch Patch5: makeman-py3.patch +# PATCH-FIX-UPSTREAM fix bad use of plain char +Patch6: signed-char.patch +# PATCH-FIX-UPSTREAM fix dependency on byte order +Patch7: big-endian.patch # bsc#1144255 disable jpeg2k support due to removal of jasper Patch8: netpbm-disable-jasper.patch BuildRequires: flex @@ -155,12 +159,13 @@ sed -i '/all-in-place/d' test/Test-Order sed -i '/legacy-names/d' test/Test-Order # picttoppm.c: #error "Unfixable. Don't ship me" sed -i '/pict-roundtrip/d' test/Test-Order -sed -i '/pict/d' test/stdin-ppm3.test -sed -i '/pict/d' test/stdin-ppm3.ok # pstopnm is not shipped sed -i '/^l\?ps.*\.test/d' test/Test-Order -# new stdin-pnm2.test failure reported to bryanh@giraffe-data.com on 2022-05-30 -sed -i 's/pstopnm -stdout : 0 0 0 1/pstopnm -stdout : 1 1 1 0/' test/stdin-pnm2.ok +# new winicon-roundtrip2.test failure reported to bryanh@giraffe-data.com on 2020-12-29 +# $ LD_LIBRARY_PATH=lib PATH=package/bin pamtowinicon -pngthreshold=1 package-test-tmp/testimg1.pam +# pamtowinicon: bad magic number 0xf0f - not a PAM, PPM, PGM, or PBM file +# $ +sed -i '/winicon-roundtrip2.test/d' test/Test-Order mkdir package-test-{tmp,results} make pkgdir=`pwd`/package tmpdir=`pwd`/package-test-tmp RESULTDIR=`pwd`/package-test-results check-package diff --git a/signed-char.patch b/signed-char.patch new file mode 100644 index 0000000..727d74c --- /dev/null +++ b/signed-char.patch @@ -0,0 +1,13 @@ +Index: netpbm-10.96.4/converter/other/pnmtopalm/palmtopnm.c +=================================================================== +--- netpbm-10.96.4.orig/converter/other/pnmtopalm/palmtopnm.c ++++ netpbm-10.96.4/converter/other/pnmtopalm/palmtopnm.c +@@ -873,7 +873,7 @@ readPackBitsRow(FILE * const if + pm_readcharu(ifP, &incountByte); + if (incountByte & 0x80) { + /* How do we handle incount == -128 ? */ +- int const signedIncount = (char)incountByte; ++ int const signedIncount = (signed char)incountByte; + unsigned int const runlength = -signedIncount + 1; + unsigned char inval; + pm_readcharu(ifP, &inval);