From 7d2009b69a9bdc12e9cdd3d578c452c751757d2f Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 27 2021 17:21:52 +0000 Subject: import netpbm-10.82.00-6.el8 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5dda91 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/netpbm-10.82.00.tar.xz diff --git a/.netpbm.metadata b/.netpbm.metadata new file mode 100644 index 0000000..ee6eb62 --- /dev/null +++ b/.netpbm.metadata @@ -0,0 +1 @@ +a33148501a050c578d0f48976a1117984bc0fe49 SOURCES/netpbm-10.82.00.tar.xz diff --git a/SOURCES/netpbm-CAN-2005-2471.patch b/SOURCES/netpbm-CAN-2005-2471.patch new file mode 100644 index 0000000..ee9935f --- /dev/null +++ b/SOURCES/netpbm-CAN-2005-2471.patch @@ -0,0 +1,17 @@ +diff -up netpbm-10.56.03/converter/other/pstopnm.c.CAN-2005-2471 netpbm-10.56.03/converter/other/pstopnm.c +--- netpbm-10.56.03/converter/other/pstopnm.c.CAN-2005-2471 2011-11-09 09:18:00.000000000 +0100 ++++ netpbm-10.56.03/converter/other/pstopnm.c 2011-11-11 11:43:51.827409226 +0100 +@@ -747,11 +747,11 @@ execGhostscript(int const input + ghostscriptProg, arg0, + deviceopt, outfileopt, gopt, ropt, textalphabitsopt, + "-q", "-dNOPAUSE", +- "-dSAFER", "-"); ++ "-dPARANOIDSAFER", "-"); + } + + execl(ghostscriptProg, arg0, deviceopt, outfileopt, gopt, ropt, "-q", +- "-dNOPAUSE", "-dSAFER", "-", NULL); ++ "-dNOPAUSE", "-dPARANOIDSAFER", "-", NULL); + + pm_error("execl() of Ghostscript ('%s') failed, errno=%d (%s)", + ghostscriptProg, errno, strerror(errno)); diff --git a/SOURCES/netpbm-CVE-2017-2587.patch b/SOURCES/netpbm-CVE-2017-2587.patch new file mode 100644 index 0000000..7e3bad7 --- /dev/null +++ b/SOURCES/netpbm-CVE-2017-2587.patch @@ -0,0 +1,26 @@ +diff -urNp old/converter/other/svgtopam.c new/converter/other/svgtopam.c +--- old/converter/other/svgtopam.c 2017-02-08 12:11:02.593690917 +0100 ++++ new/converter/other/svgtopam.c 2017-02-08 13:49:38.319029371 +0100 +@@ -771,12 +771,17 @@ createCanvas(unsigned int const width, + + MALLOCVAR_NOFAIL(canvasP); + +- canvasP->width = width; +- canvasP->height = height; +- canvasP->pixels = ppm_allocarray(width, height); +- canvasP->maxval = maxval; ++ if(canvasP != NULL){ ++ canvasP->width = width; ++ canvasP->height = height; ++ canvasP->pixels = ppm_allocarray(width, height); ++ canvasP->maxval = maxval; ++ ++ *canvasPP = canvasP; ++ } else { ++ pm_error("can't allocate memory for canvas"); ++ } + +- *canvasPP = canvasP; + } + + diff --git a/SOURCES/netpbm-annocheck.patch b/SOURCES/netpbm-annocheck.patch new file mode 100644 index 0000000..e5ec423 --- /dev/null +++ b/SOURCES/netpbm-annocheck.patch @@ -0,0 +1,24 @@ +diff -urNp a/buildtools/Makefile b/buildtools/Makefile +--- a/buildtools/Makefile 2018-09-24 11:36:56.173535757 +0200 ++++ b/buildtools/Makefile 2018-09-24 11:40:09.537553859 +0200 +@@ -44,7 +44,7 @@ genfontc:%:%.o $(NETPBMLIB) + $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $< $(NETPBMLIB) + + $(BUILDPROGS):%:%.o +- $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $< ++ $(LD_FOR_BUILD) -o $@ $(LDFLAGSPRE) $< + + distclean clean: cleanlocal + .PHONY: cleanlocal +diff -urNp a/test/Makefile b/test/Makefile +--- a/test/Makefile 2018-09-24 11:36:56.211535549 +0200 ++++ b/test/Makefile 2018-09-24 12:40:56.440812065 +0200 +@@ -18,7 +18,7 @@ testrandom.o: testrandom.c + $(CC_FOR_BUILD) -c -o $@ $(CFLAGS_FOR_BUILD) $< + + testrandom: testrandom.o +- $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $< ++ $(LD_FOR_BUILD) -o $@ $(LDFLAGSPRE) $< + + RAND_VARIETY ?= $(shell ./testrandom -x) + diff --git a/SOURCES/netpbm-bmptopnm.patch b/SOURCES/netpbm-bmptopnm.patch new file mode 100644 index 0000000..9095427 --- /dev/null +++ b/SOURCES/netpbm-bmptopnm.patch @@ -0,0 +1,11 @@ +--- netpbm-10.35/converter/other/bmptopnm.c.bmptopnm 2007-01-29 13:08:46.000000000 +0100 ++++ netpbm-10.35/converter/other/bmptopnm.c 2007-01-29 13:32:21.000000000 +0100 +@@ -1262,7 +1262,7 @@ readBmp(FILE * const ifP, + xel ** const colormapP, + bool const verbose) { + +- xel * colormap; /* malloc'ed */ ++ xel * colormap = NULL; /* malloc'ed */ + unsigned int pos; + /* Current byte position in the BMP file */ + diff --git a/SOURCES/netpbm-cmuwtopbm.patch b/SOURCES/netpbm-cmuwtopbm.patch new file mode 100644 index 0000000..f5b328b --- /dev/null +++ b/SOURCES/netpbm-cmuwtopbm.patch @@ -0,0 +1,21 @@ +diff -up netpbm-10.61.01/converter/pbm/cmuwmtopbm.c.cmuwtopbmfix netpbm-10.61.01/converter/pbm/cmuwmtopbm.c +--- netpbm-10.61.01/converter/pbm/cmuwmtopbm.c.cmuwtopbmfix 2013-01-02 18:39:57.000000000 +0100 ++++ netpbm-10.61.01/converter/pbm/cmuwmtopbm.c 2013-01-03 05:41:36.024984241 +0100 +@@ -18,7 +18,7 @@ + This program does not check the pad bits at the end of each row. + */ + +- ++#include + #include "pbm.h" + + /*-------------------------- +@@ -42,7 +42,7 @@ readCmuwmHeader(FILE * const ifP + "CMU window manager header EOF / read error"; + uint32_t const cmuwmMagic = 0xf10040bb; + +- long l; ++ uint32_t l; + short s; + int rc; + diff --git a/SOURCES/netpbm-covscan.patch b/SOURCES/netpbm-covscan.patch new file mode 100644 index 0000000..b3e7338 --- /dev/null +++ b/SOURCES/netpbm-covscan.patch @@ -0,0 +1,351 @@ +diff -urNp a/converter/other/fiasco/lib/error.c b/converter/other/fiasco/lib/error.c +--- a/converter/other/fiasco/lib/error.c 2018-09-26 11:45:35.787418476 +0200 ++++ b/converter/other/fiasco/lib/error.c 2018-09-27 08:35:35.051707228 +0200 +@@ -89,8 +89,10 @@ set_error(const char *format, ...) { + } else if (*str == 'c') { + (void)va_arg(args, int); + len += 1; +- } else ++ } else { ++ va_end(args); + return; ++ } + ++str; + } + va_end(args); +@@ -204,8 +206,10 @@ warning (const char *format, ...) + + VA_START (args, format); + +- if (verboselevel == FIASCO_NO_VERBOSITY) ++ if (verboselevel == FIASCO_NO_VERBOSITY) { ++ va_end (args); + return; ++ } + + fprintf (stderr, "Warning: "); + vfprintf (stderr, format, args); +@@ -224,8 +228,10 @@ message (const char *format, ...) + + VA_START (args, format); + +- if (verboselevel == FIASCO_NO_VERBOSITY) ++ if (verboselevel == FIASCO_NO_VERBOSITY) { ++ va_end(args); + return; ++ } + + vfprintf (stderr, format, args); + fputc ('\n', stderr); +@@ -242,8 +248,10 @@ debug_message (const char *format, ...) + + VA_START (args, format); + +- if (verboselevel < FIASCO_ULTIMATE_VERBOSITY) ++ if (verboselevel < FIASCO_ULTIMATE_VERBOSITY) { ++ va_end (args); + return; ++ } + + fprintf (stderr, "*** "); + vfprintf (stderr, format, args); +@@ -261,8 +269,10 @@ info (const char *format, ...) + + VA_START (args, format); + +- if (verboselevel == FIASCO_NO_VERBOSITY) ++ if (verboselevel == FIASCO_NO_VERBOSITY) { ++ va_end (args); + return; ++ } + + vfprintf (stderr, format, args); + fflush (stderr); +diff -urNp a/converter/other/gemtopnm.c b/converter/other/gemtopnm.c +--- a/converter/other/gemtopnm.c 2018-09-26 11:45:35.791418469 +0200 ++++ b/converter/other/gemtopnm.c 2018-09-27 08:36:51.058648634 +0200 +@@ -101,10 +101,11 @@ main(argc, argv) + + if (planes == 1) + type = PBM_TYPE; +- else ++ else + type = PPM_TYPE; + +- pnm_writepnminit( stdout, cols, rows, MAXVAL, type, 0 ); ++ pnm_writepnminit( stdout, cols, rows, MAXVAL, type, 0 ); ++ + + overflow_add(cols, padright); + { +diff -urNp a/converter/other/jbig/jbigtopnm.c b/converter/other/jbig/jbigtopnm.c +--- a/converter/other/jbig/jbigtopnm.c 2018-09-26 11:45:35.779418489 +0200 ++++ b/converter/other/jbig/jbigtopnm.c 2018-09-26 12:30:12.498686400 +0200 +@@ -279,6 +279,7 @@ int main (int argc, char **argv) + } + + pm_close(fout); ++ pm_close(fin); + + jbg_dec_free(&s); + +diff -urNp a/converter/other/jbig/libjbig/jbig.c b/converter/other/jbig/libjbig/jbig.c +--- a/converter/other/jbig/libjbig/jbig.c 2018-09-26 11:45:35.779418489 +0200 ++++ b/converter/other/jbig/libjbig/jbig.c 2018-09-26 12:32:47.179520102 +0200 +@@ -887,7 +887,7 @@ void jbg_enc_options(struct jbg_enc_stat + if (order >= 0 && order <= 0x0f) s->order = order; + if (options >= 0) s->options = options; + if (l0 > 0) s->l0 = l0; +- if (mx >= 0 && my < 128) s->mx = mx; ++ if (mx >= 0 && mx < 128) s->mx = mx; + if (my >= 0 && my < 256) s->my = my; + + return; +diff -urNp a/converter/other/jpeg2000/jpeg2ktopam.c b/converter/other/jpeg2000/jpeg2ktopam.c +--- a/converter/other/jpeg2000/jpeg2ktopam.c 2018-09-26 11:45:35.774418498 +0200 ++++ b/converter/other/jpeg2000/jpeg2ktopam.c 2018-09-26 12:47:13.369571321 +0200 +@@ -135,11 +135,11 @@ readJ2k(const char * const inputFilena + + jasperP = jas_image_decode(instreamP, jas_image_getfmt(instreamP), + (char*)options); +- if (jasperP == NULL) ++ if (jasperP == NULL) { + pm_error("Unable to interpret JPEG-2000 input. " + "The Jasper library jas_image_decode() subroutine failed."); +- +- jas_stream_close(instreamP); ++ } ++ jas_stream_close(instreamP); + + *jasperPP = jasperP; + } +diff -urNp a/converter/other/jpeg2000/libjasper/jpc/jpc_util.c b/converter/other/jpeg2000/libjasper/jpc/jpc_util.c +--- a/converter/other/jpeg2000/libjasper/jpc/jpc_util.c 2018-09-26 11:45:35.774418498 +0200 ++++ b/converter/other/jpeg2000/libjasper/jpc/jpc_util.c 2018-09-26 12:50:30.121353853 +0200 +@@ -151,7 +151,7 @@ int jpc_atoaf(const char *s, int *numval + if ((cp = strtok(buf, delim))) { + ++n; + while ((cp = strtok(0, delim))) { +- if (cp != '\0') { ++ if (*cp != '\0') { + ++n; + } + } +@@ -169,7 +169,7 @@ int jpc_atoaf(const char *s, int *numval + vs[n] = atof(cp); + ++n; + while ((cp = strtok(0, delim))) { +- if (cp != '\0') { ++ if (*cp != '\0') { + vs[n] = atof(cp); + ++n; + } +diff -urNp a/converter/other/jpeg2000/pamtojpeg2k.c b/converter/other/jpeg2000/pamtojpeg2k.c +--- a/converter/other/jpeg2000/pamtojpeg2k.c 2018-09-26 11:45:35.774418498 +0200 ++++ b/converter/other/jpeg2000/pamtojpeg2k.c 2018-09-26 12:52:06.202247510 +0200 +@@ -355,7 +355,7 @@ convertToJasperImage(struct pam * cons + JAS_IMAGE_CT_COLOR(JAS_IMAGE_CT_RGB_B)); + } + } else { +- if (strncmp(inpamP->tuple_type, "GRAYSCALE", 9 == 0) || ++ if (strncmp(inpamP->tuple_type, "GRAYSCALE", 9) == 0 || + strncmp(inpamP->tuple_type, "BLACKANDWHITE", 13) == 0) { + jas_image_setclrspc(jasperP, JAS_CLRSPC_GENGRAY); + jas_image_setcmpttype(jasperP, 0, +diff -urNp a/converter/pbm/pbmtoln03.c b/converter/pbm/pbmtoln03.c +--- a/converter/pbm/pbmtoln03.c 2018-09-26 11:45:35.769418507 +0200 ++++ b/converter/pbm/pbmtoln03.c 2018-09-26 13:15:36.205121268 +0200 +@@ -80,22 +80,25 @@ output_sixel_record (unsigned char * rec + /* Do an encoding */ + record[j++] = '!' ; + sprintf (repeated_str, "%d", i - start_repeat) ; +- for (p = repeated_str ; *p ; p++) ++ for (p = repeated_str ; *p ; p++) { + record[j++] = *p ; +- record[j++] = last_char ; } ++ } ++ record[j++] = last_char ; + +- else { ++ } else { + for (k = 0 ; k < repeated ; k++) +- record[j++] = last_char ; } ++ record[j++] = last_char ; ++ } + + start_repeat = i ; +- last_char = record[i] ; } ++ last_char = record[i] ; + } ++ } + + fwrite ((char *) record, j, 1, stdout) ; + putchar ('-') ; /* DECGNL (graphics new-line) */ + putchar ('\n') ; +- } ++} + + + static void +diff -urNp a/converter/pbm/pbmtomacp.c b/converter/pbm/pbmtomacp.c +--- a/converter/pbm/pbmtomacp.c 2018-09-26 11:45:35.769418507 +0200 ++++ b/converter/pbm/pbmtomacp.c 2018-09-26 14:47:55.085913872 +0200 +@@ -177,7 +177,7 @@ calculateCropPad(struct CmdlineInfo + pm_message("Specified -bottom value %u is beyond edge of " + "input image", cmdline.bottom); + +- bottom = MIN3(cmdline.bottom, rows - 1, top + MACP_ROWS - 1); ++ bottom = MIN3(cmdline.bottom, rows - 1, top + MACP_ROWS - 1); + } else + bottom = MIN(rows - 1, top + MACP_ROWS - 1); + +diff -urNp a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c +--- a/converter/pbm/pbmtoppa/pbm.c 2018-09-26 11:45:35.769418507 +0200 ++++ b/converter/pbm/pbmtoppa/pbm.c 2018-09-26 14:49:51.956959516 +0200 +@@ -12,6 +12,7 @@ + #include + #include + ++#include "ppm.h" + #include "ppapbm.h" + + int make_pbm_stat(pbm_stat* pbm,FILE* fptr) +diff -urNp a/converter/ppm/pjtoppm.c b/converter/ppm/pjtoppm.c +--- a/converter/ppm/pjtoppm.c 2018-09-26 11:45:35.797418458 +0200 ++++ b/converter/ppm/pjtoppm.c 2018-09-26 14:52:41.300937179 +0200 +@@ -11,6 +11,7 @@ + */ + + #include "ppm.h" ++#include "pm.h" + #include "mallocvar.h" + + static char usage[] = "[paintjetfile]"; +diff -urNp a/converter/ppm/ppmtomitsu.c b/converter/ppm/ppmtomitsu.c +--- a/converter/ppm/ppmtomitsu.c 2018-09-26 11:45:35.797418458 +0200 ++++ b/converter/ppm/ppmtomitsu.c 2018-09-26 14:56:09.837804961 +0200 +@@ -651,9 +651,10 @@ main(int argc, char * argv[]) { + dpi300 = TRUE; + else if (pm_keymatch(argv[argn], "-tiny", 2)) + tiny = TRUE; +- else ++ else + pm_usage(usage); +- ++argn; ++ ++ ++argn; + } + + if (argn < argc) { +diff -urNp a/converter/ppm/tgatoppm.c b/converter/ppm/tgatoppm.c +--- a/converter/ppm/tgatoppm.c 2018-09-26 11:45:35.795418462 +0200 ++++ b/converter/ppm/tgatoppm.c 2018-09-26 15:03:12.084322787 +0200 +@@ -168,8 +168,8 @@ get_pixel(FILE * const ifP, pixel * dest + Red = getbyte( ifP ); + if ( Size == 32 ) + Alpha = getbyte( ifP ); +- else +- Alpha = 0; ++ else ++ Alpha = 0; + l = 0; + break; + +diff -urNp a/converter/ppm/xpmtoppm.c b/converter/ppm/xpmtoppm.c +--- a/converter/ppm/xpmtoppm.c 2018-09-26 11:45:35.795418462 +0200 ++++ b/converter/ppm/xpmtoppm.c 2018-09-26 15:09:39.763747185 +0200 +@@ -941,8 +941,8 @@ convertRaster(FILE * cons + if (imageOutFileP) + ppm_writeppmrow(imageOutFileP, + pixrow, cols, PPM_MAXMAXVAL, 0); +- if (alphaOutFileP) +- pbm_writepbmrow(alphaOutFileP, alpharow, cols, 0); ++ if (alphaOutFileP) ++ pbm_writepbmrow(alphaOutFileP, alpharow, cols, 0); + } + + pbm_freerow(alpharow); +diff -urNp a/editor/pnmconvol.c b/editor/pnmconvol.c +--- a/editor/pnmconvol.c 2018-09-26 11:45:35.758418526 +0200 ++++ b/editor/pnmconvol.c 2018-09-26 15:25:06.963058646 +0200 +@@ -733,7 +733,7 @@ parsePlaneFileLine(const char * const + "-matrix value is not a valid floating point " + "number", colCt, line); + +- ++colCt; ++ ++colCt; + } + pm_strfree(token); + } +diff -urNp a/generator/pbmtext.c b/generator/pbmtext.c +--- a/generator/pbmtext.c 2018-09-26 11:45:35.727418580 +0200 ++++ b/generator/pbmtext.c 2018-09-26 15:29:14.618407929 +0200 +@@ -404,7 +404,7 @@ fixControlChars(const PM_WCHAR * const + output[outCursor++] = L' '; + } else if (currentChar > fontP->maxglyph || + !fontP->glyph[currentChar]) { +- if (currentChar > PM_FONT2_MAXGLYPH) ++ if (currentChar > PM_FONT2_MAXGLYPH){ + pm_message("code point %X is beyond what this program " + "can handle. Max=%X", + (unsigned int)currentChar, PM_FONT2_MAXGLYPH); +@@ -420,15 +420,15 @@ fixControlChars(const PM_WCHAR * const + (unsigned int) currentChar ); + output[outCursor++] = ' '; + } ++ } + } else + output[outCursor++] = input[inCursor]; +- ++ + assert(outCursor <= outputSize); + } + output[outCursor++] = L'\0'; + + assert(outCursor <= outputSize); +- + *outputP = output; + } + +diff -urNp a/lib/libpm.c b/lib/libpm.c +--- a/lib/libpm.c 2018-09-26 11:45:35.768418509 +0200 ++++ b/lib/libpm.c 2018-09-27 08:20:50.933203723 +0200 +@@ -437,9 +437,10 @@ pm_maxvaltobits(int const maxval) { + return 15; + else if ( (long) maxval <= 65535L ) + return 16; +- else ++ else { + pm_error( "maxval of %d is too large!", maxval ); + return -1; /* Should never come here */ ++ } + } + + int +diff -urNp a/other/pamfix.c b/other/pamfix.c +--- a/other/pamfix.c 2018-09-26 11:45:35.755418531 +0200 ++++ b/other/pamfix.c 2018-09-27 08:23:00.923166374 +0200 +@@ -184,7 +184,7 @@ clipPamRow(const struct pam * const pamP + "image maxval of %lu", + row, col, plane, tuplerow[col][plane], + pamP->maxval); +- tuplerow[col][plane] = pamP->maxval; ++ tuplerow[col][plane] = pamP->maxval; + } + } + } +diff -urNp a/other/pnmcolormap.c b/other/pnmcolormap.c +--- a/other/pnmcolormap.c 2018-09-26 11:45:35.756418529 +0200 ++++ b/other/pnmcolormap.c 2018-09-27 08:28:57.053986251 +0200 +@@ -838,9 +838,10 @@ colormapToSquare(struct pam * const pamP + unsigned int const intsqrt = (int)sqrt((float)colormap.size); + if (intsqrt * intsqrt == colormap.size) + pamP->width = intsqrt; +- else ++ else { + pamP->width = intsqrt + 1; + overflow_add(intsqrt, 1); ++ } + } + { + unsigned int const intQuotient = colormap.size / pamP->width; diff --git a/SOURCES/netpbm-docfix.patch b/SOURCES/netpbm-docfix.patch new file mode 100644 index 0000000..33b3b77 --- /dev/null +++ b/SOURCES/netpbm-docfix.patch @@ -0,0 +1,124 @@ +diff -urNp old/userguide/cameratopam.html new/userguide/cameratopam.html +--- old/userguide/cameratopam.html 2017-09-05 09:05:16.000000000 +0200 ++++ new/userguide/cameratopam.html 2017-09-05 13:16:33.622352535 +0200 +@@ -25,10 +25,10 @@ cameratopam - convert raw camera image t + [-balance_camera] + [-red_scale=float] + [-blue_scale=float] +-[-brightness=fraction] ++[-bright=fraction] + [-no_clip_color] + [-rgb] +-[-secondary] ++[-use_secondary] + [-linear] + [-verbose] + +@@ -106,7 +106,7 @@ the default. +
Further adjust the color balance by multiplying the red and blue + channels by these values. Both default to 1.0. + +-
-brightness=float ++
-bright=float + +
Change the output brightness. Default is 1.0. + +@@ -114,14 +114,14 @@ channels by these values. Both default + +
By default, cameratoapm clips all colors to prevent pink + hues in the highlights. Combine this option with +--brightness=0.25 to leave the image data completely unclipped. ++-bright=0.25 to leave the image data completely unclipped. + +
-rgb + +
Write raw camera colors to the output file. By default, + cameratoapm converts to sRGB colorspace. + +-
-secondary ++
-use_secondary + +
For cameras based on the Fuji Super CCD SR, this option causes + cameratopam to use the secondary sensors, in effect +diff -urNp old/userguide/fiascotopnm.html new/userguide/fiascotopnm.html +--- old/userguide/fiascotopnm.html 2017-09-05 09:05:16.000000000 +0200 ++++ new/userguide/fiascotopnm.html 2017-09-05 13:32:51.810458154 +0200 +@@ -51,7 +51,7 @@ the output file(s) are written to the fi + this list. Otherwise, the current directory is used to store the + output file(s). + +-
-z, --fast ++
-r, --fast +
+ Decompress images in the 4:2:0 format; i.e., each chroma channel is + decompressed to an image of halved width and height. Use this option +@@ -83,7 +83,7 @@ given amount N. N is 1 (mi + is 70. When N=0, then the smoothing amount specified in the + FIASCO file is used (defined by the FIASCO coder). + +-
-F N, --fps=N ++
-F N, --framerate=N +
+ Set number of frames per second to N. When using this option, + the frame rate specified in the FIASCO file is overridden. +@@ -113,13 +113,8 @@ following methods (in the specified orde +
  • --config=name + + +-
    -h, --info +-
    +-Print brief help, then exit. +- +-
    -H, --help +-
    +-Print detailed help, then exit. ++
    -h, --help ++Print help, then exit. + + + +diff -urNp old/userguide/pamperspective.html new/userguide/pamperspective.html +--- old/userguide/pamperspective.html 2017-09-05 09:05:16.000000000 +0200 ++++ new/userguide/pamperspective.html 2017-09-05 13:23:15.869997105 +0200 +@@ -220,7 +220,7 @@ default rectangle as the "frame." The vi + a rectangle the axes of which are parallel to those of the frame. + +

    The frame options are additive. All the parts of the image +-specified by either margin options, --include_frame, or ++specified by either margin options, --frame_include, or + --include (or their defaults) are in the visible part. The + visible part is the smallest possible rectangle that contains the + parts specified those three ways. +diff -urNp old/converter/pbm/pbmtoepson.c new/converter/pbm/pbmtoepson.c +--- old/converter/pbm/pbmtoepson.c 2018-01-04 14:26:14.740024843 +0100 ++++ new/converter/pbm/pbmtoepson.c 2018-01-04 14:28:47.970518766 +0100 +@@ -75,7 +75,7 @@ parseCommandLine(int ar + &dpiSpec, 0); + OPTENT3(0, "adjacent", OPT_FLAG, NULL, + &adjacentSpec, 0); +- OPTENT3(0, "nonadjacent", OPT_FLAG, NULL, ++ OPTENT3(0, "noadjacent", OPT_FLAG, NULL, + &nonadjacentSpec, 0); + + opt.opt_table = option_def; +diff -urNp old/userguide/pbmtoepson.html new/userguide/pbmtoepson.html +--- old/userguide/pbmtoepson.html 2018-01-04 14:26:14.586024719 +0100 ++++ new/userguide/pbmtoepson.html 2018-01-04 14:27:56.466847698 +0100 +@@ -18,7 +18,7 @@ pbmtoepson - convert a PBM image into Ep + [-dpi=n] + [-protocol={escp9|escp}] + [-adjacent] +-[-nonadjacent] ++[-noadjacent] + + [pbmfile] + +@@ -74,7 +74,7 @@ print density for you consistent with yo +

    This option was new in Netpbm 10.23 (July 2004). + +

    -adjacent +-
    -nonadjacent ++
    -noadjacent + +
    These options determine whether the output uses "adjacent dot + printing" or not, whatever that is. diff --git a/SOURCES/netpbm-fiasco-overflow.patch b/SOURCES/netpbm-fiasco-overflow.patch new file mode 100644 index 0000000..850dbc3 --- /dev/null +++ b/SOURCES/netpbm-fiasco-overflow.patch @@ -0,0 +1,12 @@ +diff -up netpbm-10.47.09/converter/other/fiasco/lib/image.h.fiasco-overflow netpbm-10.47.09/converter/other/fiasco/lib/image.h +--- netpbm-10.47.09/converter/other/fiasco/lib/image.h.fiasco-overflow 2010-01-25 09:00:48.000000000 +0100 ++++ netpbm-10.47.09/converter/other/fiasco/lib/image.h 2010-01-27 10:29:48.000000000 +0100 +@@ -29,7 +29,7 @@ typedef struct image + * Image data + */ + { +- char id [7]; ++ char id [8]; + unsigned reference_count; + unsigned width; /* Width of the image */ + unsigned height; /* Height of the image */ diff --git a/SOURCES/netpbm-gcc4.patch b/SOURCES/netpbm-gcc4.patch new file mode 100644 index 0000000..3f51826 --- /dev/null +++ b/SOURCES/netpbm-gcc4.patch @@ -0,0 +1,22 @@ +diff -up netpbm-10.58.01/lib/pm.h.gcc4 netpbm-10.58.01/lib/pm.h +--- netpbm-10.58.01/lib/pm.h.gcc4 2012-04-09 19:08:08.885137097 +0200 ++++ netpbm-10.58.01/lib/pm.h 2012-04-09 19:08:08.894136984 +0200 +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff -up netpbm-10.58.01/urt/rle.h.gcc4 netpbm-10.58.01/urt/rle.h +--- netpbm-10.58.01/urt/rle.h.gcc4 2012-04-09 19:08:08.000000000 +0200 ++++ netpbm-10.58.01/urt/rle.h 2012-04-09 19:08:39.137758887 +0200 +@@ -34,6 +34,7 @@ + #define RLE_H + + #include /* Declare FILE. */ ++#include + + enum rle_dispatch { + NO_DISPATCH = -1, diff --git a/SOURCES/netpbm-glibc.patch b/SOURCES/netpbm-glibc.patch new file mode 100644 index 0000000..4ae71e8 --- /dev/null +++ b/SOURCES/netpbm-glibc.patch @@ -0,0 +1,13 @@ +--- netpbm-10.35/converter/other/pnmtotiffcmyk.c.glibc 2006-09-18 12:20:06.000000000 +0200 ++++ netpbm-10.35/converter/other/pnmtotiffcmyk.c 2007-08-23 09:18:30.000000000 +0200 +@@ -974,8 +974,8 @@ int main( int argc, char **argv ) { + + if ( (err = parseOpts( argc, argv, rt )) ) goto exit ; + +- if ( (err = rt->in->open( rt->in, rt )) ) goto exit ; +- if ( (err = rt->out->open( rt->out, rt )) ) goto exit ; ++ if ( (err = (rt->in->open)( rt->in, rt )) ) goto exit ; ++ if ( (err = (rt->out->open)( rt->out, rt )) ) goto exit ; + + while ( rt->in->hasMore( rt->in ) ) { + if ( (err = rt->in->next( rt->in, &r, &g, &b )) ) goto exit ; diff --git a/SOURCES/netpbm-jasper.patch b/SOURCES/netpbm-jasper.patch new file mode 100644 index 0000000..3964fc9 --- /dev/null +++ b/SOURCES/netpbm-jasper.patch @@ -0,0 +1,62 @@ +diff -urNp a/config.mk.in b/config.mk.in +--- a/config.mk.in 2018-11-21 12:46:22.044790058 +0100 ++++ b/config.mk.in 2018-11-22 13:13:10.260123268 +0100 +@@ -128,7 +128,7 @@ INSTALL = $(SRCDIR)/buildtools/install.s + + # STRIPFLAG is the option you pass to the above install program to make it + # strip unnecessary information out of binaries. +-STRIPFLAG = -s ++STRIPFLAG = + # If you don't want to strip the binaries, just leave it null: + #STRIPFLAG = + +@@ -482,12 +482,12 @@ JBIGLIB = $(INTERNAL_JBIGLIB) + JBIGHDR_DIR = $(INTERNAL_JBIGHDR_DIR) + + # The Jasper JPEG-2000 image compression library (aka JasPer): +-JASPERLIB = $(INTERNAL_JASPERLIB) +-JASPERHDR_DIR = $(INTERNAL_JASPERHDR_DIR) ++JASPERLIB = "" ++JASPERHDR_DIR = "/usr/include/jasper" + # JASPERDEPLIBS is the libraries (-l options or file names) on which + # The Jasper library depends -- i.e. what you have to link into any + # executable that links in the Jasper library. +-JASPERDEPLIBS = ++JASPERDEPLIBS = -ljasper + #JASPERDEPLIBS = -ljpeg + + # And the Utah Raster Toolkit (aka URT aka RLE) library: +diff -urNp a/converter/other/jbig/Makefile b/converter/other/jbig/Makefile +--- a/converter/other/jbig/Makefile 2018-11-21 12:46:22.075789920 +0100 ++++ b/converter/other/jbig/Makefile 2018-11-22 13:13:40.837969056 +0100 +@@ -11,8 +11,9 @@ include $(BUILDDIR)/config.mk + + # INTERNAL_JBIGLIB must be relative to the current directory, because it + # may end up in MERGE_OBJECTS, which must be relative. +-INTERNAL_JBIGLIB = libjbig/libjbig.a +-INTERNAL_JBIGHDR_DIR = $(SRCDIR)/$(SUBDIR)/libjbig/include ++INTERNAL_JBIGLIB = ++INTERNAL_JBIGHDR_DIR = /usr/include ++#INTERNAL_JBIGHDR_DIR = $(SRCDIR)/$(SUBDIR)/libjbig/include + + EXTERN_INCLUDES = + ifneq ($(JBIGHDR_DIR),NONE) +@@ -35,7 +36,6 @@ SCRIPTS = + + ifeq ($(JBIGLIB),$(INTERNAL_JBIGLIB)) + JBIGLIB_DEP = $(JBIGLIB) +- SUBDIRS += libjbig + else + # It's not our internal version; user's on his own to make sure it's built + endif +@@ -49,10 +49,3 @@ include $(SRCDIR)/common.mk + + $(BINARIES): %: %.o $(JBIGLIB_DEP) $(LIBOPT) + $(BINARIES): LDFLAGS_TARGET = $(shell $(LIBOPT) $(JBIGLIB)) +- +-$(INTERNAL_JBIGLIB): $(BUILDDIR)/$(SUBDIR)/libjbig FORCE +- $(MAKE) -f $(SRCDIR)/$(SUBDIR)/libjbig/Makefile \ +- -C $(dir $@) $(notdir $@) +- +-.PHONY: FORCE +-FORCE: diff --git a/SOURCES/netpbm-manfix.patch b/SOURCES/netpbm-manfix.patch new file mode 100644 index 0000000..54df85f --- /dev/null +++ b/SOURCES/netpbm-manfix.patch @@ -0,0 +1,184 @@ +diff -urNp old/userguide/avstopam.html new/userguide/avstopam.html +--- old/userguide/avstopam.html 2017-09-05 13:58:08.338559550 +0200 ++++ new/userguide/avstopam.html 2017-09-05 14:00:27.371039472 +0200 +@@ -1,8 +1,7 @@ + +- ++ + + Avstopam User Manual +- + + + +diff -urNp old/userguide/escp2topbm.html new/userguide/escp2topbm.html +--- old/userguide/escp2topbm.html 2017-09-05 13:58:08.335559561 +0200 ++++ new/userguide/escp2topbm.html 2017-09-05 14:01:20.226842694 +0200 +@@ -6,6 +6,7 @@ Updated: 14 July 2015 +
    + Table Of Contents + ++

    NAME

    + escp2topbm - convert an ESC/P2 printer file to a PBM image + +

    SYNOPSIS

    +diff -urNp old/userguide/faxformat.html new/userguide/faxformat.html +--- old/userguide/faxformat.html 2017-09-05 13:58:08.337559553 +0200 ++++ new/userguide/faxformat.html 2017-09-05 14:02:33.322571279 +0200 +@@ -5,10 +5,11 @@ + Updated: 03 December 2008 +
    + ++

    SYNOPSIS

    +

    This page, part of the Netpbm user's guide, + describes FAX formats in relation to Netpbm facilities. + +- ++

    DESCRIPTION

    +

    The ITU (formerly CCITT) publishes standards for operation of fax machines + (the idea is to provide a way to be sure that a fax machine is able to receive + a fax sent by another). These standards incidentally specify graphics file +diff -urNp old/userguide/pampaintspill.html new/userguide/pampaintspill.html +--- old/userguide/pampaintspill.html 2017-09-05 13:58:08.338559550 +0200 ++++ new/userguide/pampaintspill.html 2017-09-05 14:03:32.625351620 +0200 +@@ -1,8 +1,7 @@ + +- ++ + + Pampaintspill User Manual +- + + + +@@ -11,6 +10,7 @@ + +

    Table Of Contents

    + ++

    NAME

    +

    pampaintspill - smoothly spill colors into the background

    + +

    SYNOPSIS

    +diff -urNp old/userguide/pamrecolor.html new/userguide/pamrecolor.html +--- old/userguide/pamrecolor.html 2017-09-05 13:58:08.336559557 +0200 ++++ new/userguide/pamrecolor.html 2017-09-05 14:04:34.714122098 +0200 +@@ -1,8 +1,7 @@ +- ++ + + + Pamrecolor User Manual +- + + + +@@ -11,7 +10,7 @@ + +

    Updated: 31 July 2010

    + +-

    Table Of Contents

    ++

    Table Of Contents

    + + +

    NAME

    +diff -urNp old/userguide/pamsistoaglyph.html new/userguide/pamsistoaglyph.html +--- old/userguide/pamsistoaglyph.html 2017-09-05 13:58:08.334559565 +0200 ++++ new/userguide/pamsistoaglyph.html 2017-09-05 14:05:25.865944327 +0200 +@@ -1,8 +1,7 @@ + +- ++ + + Pamsistoaglyph User Manual +- + + + +diff -urNp old/userguide/pamstereogram.html new/userguide/pamstereogram.html +--- old/userguide/pamstereogram.html 2017-09-05 13:58:08.337559553 +0200 ++++ new/userguide/pamstereogram.html 2017-09-05 14:13:28.523959069 +0200 +@@ -1,5 +1,5 @@ +- +- ++ ++ + + Pamstereogram User Manual + +@@ -10,7 +10,7 @@ + +

    Updated: 19 June 2015

    + +-

    Table Of Contents

    ++

    Table Of Contents

    + + +

    NAME

    +diff -urNp old/userguide/pamtoavs.html new/userguide/pamtoavs.html +--- old/userguide/pamtoavs.html 2017-09-05 13:58:08.329559583 +0200 ++++ new/userguide/pamtoavs.html 2017-09-05 14:05:49.299863901 +0200 +@@ -1,5 +1,5 @@ + +- ++ + + Pamtoavs User Manual + +diff -urNp old/userguide/pamtooctaveimg.html new/userguide/pamtooctaveimg.html +--- old/userguide/pamtooctaveimg.html 2017-09-05 13:58:08.335559561 +0200 ++++ new/userguide/pamtooctaveimg.html 2017-09-05 14:06:21.825752356 +0200 +@@ -1,8 +1,7 @@ + +- ++ + + Pamtooctaveimg User Manual +- + + + +diff -urNp old/userguide/pnmflip.html new/userguide/pnmflip.html +--- old/userguide/pnmflip.html 2017-09-05 13:58:08.336559557 +0200 ++++ new/userguide/pnmflip.html 2017-09-05 14:07:15.065963977 +0200 +@@ -4,9 +4,11 @@ + +

    pnmflip

    +
    ++

    NAME

    +

    pnmflip was replaced in Netpbm 10.13 (December 2002) by + pamflip. + ++

    DESCRIPTION

    +

    pamflip is mostly backward compatible with pnmflip, + but works on PAM images too. + +diff -urNp old/userguide/pnmmercator.html new/userguide/pnmmercator.html +--- old/userguide/pnmmercator.html 2017-09-05 13:58:08.334559565 +0200 ++++ new/userguide/pnmmercator.html 2017-09-05 14:08:08.305214742 +0200 +@@ -1,7 +1,6 @@ +- ++ + + +- + PnmMercator User Manual + + +diff -urNp old/userguide/ppmtogif.html new/userguide/ppmtogif.html +--- old/userguide/ppmtogif.html 2017-09-05 13:58:08.337559553 +0200 ++++ new/userguide/ppmtogif.html 2017-09-05 14:09:51.450583126 +0200 +@@ -4,11 +4,14 @@ + +

    ppmtogif

    +
    ++

    NAME

    +

    ppmtogif was replaced in Netpbm 10.37 (December 2006) by + pamtogif. + ++

    SYNOPSIS

    +

    pamtogif is mostly backward compatible with ppmtogif. + ++

    DESCRIPTION

    +

    One way pamtogif is not backward compatible with ppmtogif + is that to specify a transparency (alpha) mask with ppmtogif, you + supply the transparency as a separate pseudo-PGM image and use the diff --git a/SOURCES/netpbm-manual-pages.patch b/SOURCES/netpbm-manual-pages.patch new file mode 100644 index 0000000..b5fbbea --- /dev/null +++ b/SOURCES/netpbm-manual-pages.patch @@ -0,0 +1,1343 @@ +diff -urNp old/userguide/libnetpbm_ug.html new/userguide/libnetpbm_ug.html +--- old/userguide/libnetpbm_ug.html 2017-09-05 14:20:09.734743404 +0200 ++++ new/userguide/libnetpbm_ug.html 2017-09-05 14:47:30.496705483 +0200 +@@ -374,7 +374,7 @@ plain format. +

    Reference

    + +

    The Libnetpbm Netpbm Image +-Processing Manual describes the the libnetpbm functions for ++Processing Manual describes the libnetpbm functions for + processing image data. + +

    The Libnetpbm Utility Manual +diff -urNp old/userguide/pamfunc.html new/userguide/pamfunc.html +--- old/userguide/pamfunc.html 2017-09-05 14:20:09.738743398 +0200 ++++ new/userguide/pamfunc.html 2017-09-05 14:47:41.760644848 +0200 +@@ -57,7 +57,7 @@ output image. + and bit string (such as and with 01001000). For the arithmetic functions, the + function arguments and results are the fraction that a sample is of the + maxval, i.e. normal interpretation of PAM tuples. But for the bit string +-functions, the value is the the bit string whose value as a binary cipher is ++functions, the value is the bit string whose value as a binary cipher is + the sample value, and the maxval indicates the width of the bit string. + +

    Arithmetic functions

    +diff -urNp old/userguide/pbmtextps.html new/userguide/pbmtextps.html +--- old/userguide/pbmtextps.html 2017-09-05 14:20:09.736743401 +0200 ++++ new/userguide/pbmtextps.html 2017-09-05 14:47:58.840553598 +0200 +@@ -185,7 +185,7 @@ edge of the type. See Margins for details. + +

    Sizes are in points, as a floating point number. +diff -urNp old/userguide/pbmtog3.html new/userguide/pbmtog3.html +--- old/userguide/pbmtog3.html 2017-09-05 14:20:09.735743403 +0200 ++++ new/userguide/pbmtog3.html 2017-09-05 14:48:55.648255793 +0200 +@@ -77,7 +77,7 @@ You cannot specify both. +

    HISTORY

    + +

    Before Netpbm 10.79 (June 2017), there was a different program by the same +-name in Netpbm, which was written by by Paul Haeberli ++name in Netpbm, which was written by Paul Haeberli + <paul@manray.sgi.com> in 1989 + and then modified extensively by others. + +diff -urNp old/userguide/ppmtompeg.html new/userguide/ppmtompeg.html +--- old/userguide/ppmtompeg.html 2017-09-05 14:20:09.739743396 +0200 ++++ new/userguide/ppmtompeg.html 1970-01-01 01:00:00.000000000 +0100 +@@ -1,1291 +0,0 @@ +- +- +- +-Ppmtompeg User Manual +- +- +-

    Ppmtompeg

    +-Updated: 23 July 2006 +-
    +-Table Of Contents +- +-

    NAME

    +-ppmtompeg - encode an MPEG-1 bitstream +- +-

    SYNOPSIS

    +- +-ppmtompeg +-[options] +-parameter-file +- +-

    DESCRIPTION

    +- +-

    This program is part of Netpbm. +- +-

    ppmtompeg produces an MPEG-1 video stream. MPEG-1 is the +-first great video compression method, and is what is used in Video CDs +-(VCD). ppmtompeg originated in the year 1995. DVD uses a more +-advanced method, MPEG-2. There is an even newer method called MPEG-4 +-which is also called Divx. I don't know where one finds that used. +- +-

    There's technically a difference between a compression method for +-video and an actual file (stream) format for a movie, and I don't know +-if it can be validly said that the format of the stream +-ppmtompeg produces is MPEG-1. +- +-

    Mencoder from the Mplayer +-package is probably superior for most video format generation +-needs, if for no other reason than that it is more popular. +- +-

    The programming library PM2V +-generates MPEG-2 streams. +- +-

    Use Mplayer (not part of Netpbm) +-to do the reverse conversion: to create a series of PNM files from an MPEG +-stream. +- +-

    param_file is a parameter file which includes a list of +-input files and other parameters. The file is described in detail +-below. +- +-

    To understand this program, you need to understand something about +-the complex MPEG-1 format. One source of information about this +-standard format is the section Introduction to MPEG in the Compression FAQ. +- +-

    OPTIONS

    +- +-

    The -gop, -combine_gops, -frames, and +--combine_frames options are all mutually exclusive. +- +-

    +-
    -stat stat_file +- +-
    This option causes ppmtompeg to append the statistics that +-it write to Standard Output to the file stat_file as well. The +-statistics use the following abbreviations: bits per block (bpb), bits +-per frame (bpf), seconds per frame (spf), and bits per second (bps). +- +-

    These statistics include how many I, P, and B frames there were, +-and information about compression and quality. +- +- +-

    -quiet num_seconds +- +-
    causes ppmtompeg not to report remaining time more often +-than every num_seconds seconds (unless the time estimate rises, +-which will happen near the beginning of the run). A negative value +-tells ppmtompeg not to report at all. 0 is the default +-(reports once after each frame). Note that the time remaining is an +-estimate and does not take into account time to read in frames. +- +-
    -realquiet
    causes ppmtompeg to run silently, +-with the only screen output being errors. Particularly useful when +-reading input from stdin. +- +-
    +--no_frame_summary +- +-
    This option prevents ppmtompeg from printing a summary +-line for each frame +- +-
    -float_dct +- +-
    forces ppmtompeg to use a more accurate, yet more +-computationally expensive version of the DCT. +- +-
    -gop gop_num +-
    +-causes ppmtompeg to encode only the numbered GOP (first GOP is 0). The +-parameter file is the same as for normal usage. The output file will be +-the normal output file with the suffix .gop.gop_num. +-ppmtompeg does not output any sequence information. +- +-
    -combine_gops +- +-
    causes ppmtompeg simply to combine some GOP files into a +-single MPEG output stream. ppmtompeg inserts a sequence header +-and trailer. In this case, the parameter file needs only to contain +-the SIZE value, an output file, and perhaps a list of input GOP +-files (see below). +- +-If you don't supply a list of input GOP files is used, then +-ppmtompeg assumes you're using the same parameter file you used +-when you created the input (with the -gop option) and +-calculates the corresponding gop filenames itself. If this is not the +-case, you can specify input GOP files in the same manner as normal +-input files -- except instead of using INPUT_DIR, INPUT, and +-END_INPUT, use GOP_INPUT_DIR, GOP_INPUT, and GOP_END_INPUT. If no +-input GOP files are specified, then the default is to use the output +-file name with suffix .gop.gop_num, with gop_num +-starting from 0, as the input files. +- +-

    Thus, unless you're mixing and matching GOP files from different +-sources, you can simply use the same parameter file for creating the +-GOP files (-gop) and for later turning them into an MPEG stream +-(-combine_gops). +- +- +-

    -frames first_frame last_frame +- +-
    This option causes ppmtompeg to encode only the frames numbered +-first_frame to last_frame, inclusive. The parameter +-file is the same as for normal usage. The output will be placed in +-separate files, one per frame, with the file names being the normal +-output file name with the suffix .frame.frame_num. No +-GOP header information is output. (Thus, the parameter file need not +-include the GOP_SIZE value) +- +-

    Use ppmtompeg -combine_frames to combine these frames later into +-an MPEG stream. +- +- +-

    -combine_frames +- +-
    This option causes ppmtompeg simply to combine some +-individual MPEG frames (such as you might have created with an earlier +-run of ppmtompeg -frames) into a single MPEG stream. Sequence +-and GOP headers are inserted appropriately. In this case, the +-parameter file needs to contain only the SIZE value, the GOP_SIZE +-value, an output file, and perhaps a list of frame files (see below). +- +-

    The parameter file may specify input frame files in the same manner +-as normal input files -- except instead of using INPUT_DIR, INPUT, and +-END_INPUT, use FRAME_INPUT_DIR, FRAME_INPUT, and FRAME_END_INPUT. If +-no input frame files are specified, then the default is to use the +-output file name with suffix .frame.frame_num, with +-frame_num starting from 0, as the input files. +- +- +- +-

    -nice +- +-
    This option causes ppmtompeg to run any remote processes +-"nicely," i.e. at low priority. (This is relevant only if you are +-running ppmtompeg in parallel mode. Otherwise, there are no +-remote processes). See 'man nice.' +- +-
    -max_machines num_machines +- +-
    This option causes ppmtompeg to use no more than +-num_machines machines as slaves for use in parallel encoding. +- +-
    -snr +- +-
    This option causes ppmtompeg to include the signal-to-noise +-ratio in the reported statistics. Prints SNR (Y U V) and peak SNR (Y +-U V) for each frame. In summary, prints averages of luminance only +-(Y). SNR is defined as 10*log(variance of original/variance of +-error). Peak SNR is defined as 20*log(255/RMSE). Note that +-ppmtompeg runs a little slower when you use this option. +- +-
    -mse +- +-
    This option causes ppmtompeg to report the mean squared +-error per block. It also automatically reports the quality of the +-images, so there is no need to specify -snr then. +- +-
    -bit_rate_info rate_file +- +-
    This option makes ppmtompeg write bit rate information +-into the file rate_file. Bit rate information is bits per frame, and +-also bits per I-frame-to-I-frame. +- +-
    -mv_histogram +- +-
    This option causes ppmtompeg to print a histogram of the +-motion vectors as part of statistics. There are three histograms -- +-one for P frame, one for forward B frame, and one for backward B frame +-motion vectors. +- +-

    The output is in the form of a matrix, each entry corresponding to one +-motion vector in the search window. The center of the matrix +-represents (0,0) motion vectors. +- +-

    -debug_sockets +- +-
    This option causes ppmtompeg to print to Standard Output +-messages that narrate the communication between the machines when you run +-ppmtompeg in parallel mode. +- +-
    -debug_machines +- +-
    This option causes ppmtompeg to print to Standard Output +-messages that narrate the progress of the conversion on the various +-machines when you run ppmtompeg in parallel +-mode. +- +-
    +- +-

    PARAMETER FILE

    +- +-

    The parameter file must contain the following +-lines (except when using the -combine_gops or -combine_frames +-options): +- +-

    +- +-
    PATTERN pattern +- +-
    This statement specifies the pattern (sequence) of I frames, P frames, +-and B frames. pattern is just a sequence of the letters I, P, and +-B with nothing between. Example: +- +-
    +-    PATTERN IBBPBBPBBPBBPBB
    +-
    +- +-

    See I Frames, P Frames, B Frames. +- +-

    OUTPUT output file +-
    This names the file where the output MPEG stream goes. +- +-
    INPUT_DIR directory +- +-
    This statement tells where the input images (frames) come from. +-If each frame is in a separate file, directory is the directory +-where they all are. You may use . to refer to the current +-directory. A null directory refers to the root directory of the +-system file tree. +- +-

    To have ppmtompeg read all the frames serially from Standard +-Input, specify +-

    +-    INPUT_DIR stdin
    +-
    +- +-
    INPUT +-
    +-This line must be followed by a list of the input files (in display order) +-and then the line END_INPUT. +- +-

    There are three types of lines between INPUT and END_INPUT. First, +-a line may simply be the name of an input file. Second, the line +-may be of the form single_star_expr +-[x-y]. +-single_star_expr can have a single * in it. It is +-replaced by all the numbers between x and y inclusive. So, for +-example, the line tennis*.ppm [12-15] refers to the files +-tennis12.ppm, tennis13.ppm, tennis14.ppm, tennis15.ppm. +- +-

    Uniform zero-padding occurs, as well. For example, the line +-football.*.ppm [001-130] refers to the files football.001.ppm, +-football.002.ppm, ..., football.009.ppm, football.010.ppm, ..., +-football.130.ppm. +- +-

    The third type of line is: single_star_expr +-[x-y+s], where the +-line is treated exactly as above, except that we skip by s. Thus, the +-line football.*.ppm [001-130+4] refers to the files +-football.001.ppm, football.005.ppm, football.009.ppm, +-football.013.ppm, etc. +- +-

    Furthermore, a line may specify a shell command to execute to +-generate lines to be interpreted as described above, as if those lines +-were in the parameter file instead. Use back ticks, like in the +-Bourne Shell, like this: +- +-

    +-    `cat myfilelist`
    +-
    +- +-

    +-If input is from Standard Input (per the INPUT_DIR statement), +-ppmtompeg ignores the INPUT/END_INPUT block, but +-it still must be present. +- +-

    BASE_FILE_FORMAT {PPM | PNM | YUV | +- JPEG | JMOVIE} +- +-
    ppmtompeg must convert all input files to one of the +-following formats as a first step of processing: PNM, YUV, JPEG(v4), +-or JMOVIE. (The conversion may be trivial if your input files are +-already in one of these formats). This line specifies which of the +-four formats. PPM is actually a subset of PNM. The separate +-specification is allowed for backward compatibility. Use PNM instead +-of PPM in new applications. +- +-
    INPUT_CONVERT conversion_command +- +-
    You must specify how to convert a file to the base file format. +-If no conversion is necessary, then you would just say: +- +-
    +-     INPUT_CONVERT *
    +-     
    +- +-

    Otherwise, conversion_command is a shell command that causes +-an image in the format your specified with BASE_FILE_FORMAT to +-be written to Standard Output. ppmtompeg executes the command +-once for each line between INPUT and END_INPUT (which is +-normally, but not necessarily, a file name). In the conversion +-command, ppmtompeg replaces each '*' with the contents of that +-line. +- +- If you had a bunch of gif files, you might say: +-

    +-     INPUT_CONVERT giftopnm *
    +-     
    +- +- If you have a bunch of separate a.Y, a.U, and a.V files (where +- the U and V have already been subsampled), then you might say: +- +-
    +-     INPUT_CONVERT cat *.Y *.U *.V
    +-     
    +- +-

    Input conversion is not allowed with input from stdin, so use +- +-

    +-     INPUT_CONVERT *
    +-     
    +- +-as described above. +- +-
    SIZE widthxheight +- +-
    +- +-

    width and height are the width and height of each +-frame in pixels. +- +-

    When ppmtompeg can get this information from the input image +-files, it ignores the SIZE parameter and you may omit it. +- +-

    When the image files are in YUV format, the files don't contain +-dimension information, so SIZE is required. +- +-

    When ppmtompeg is running in parallel mode, not all of the +-processes in the network have access to the image files, so +-SIZE is required and must give the same dimensions as the +-input image files. +- +-

    YUV_SIZE widthxheight +- +-
    This is an obsolete synonym of SIZE. +- +-
    YUV_FORMAT {ABEKAS | PHILLIPS | UCB | +- EYUV | pattern} +- +-
    This is meaningful only when BASE_FILE_FORMAT specifies +-YUV format, and then it is required. It specifies the sub-format of +-the YUV class. +- +- +-
    GOP_SIZE n +- +-
    n is the number of frames in a Group of Pictures. Except that +-because a GOP must start with an I frame, ppmtompeg makes a GOP as +-much longer than n as it has to to make the next GOP start with an +-I frame. +- +-

    Normally, it makes sense to make your GOP size a multiple of your +-pattern length (the latter is determined by the PATTERN parameter file +-statement). +- +-

    See Group Of Pictures. +- +-

    SLICES_PER_FRAME n +-
    n is roughly the number of slices per frame. Note, at +-least one MPEG player may complain if slices do not start at the left +-side of an image. To ensure this does not happen, make sure the +-number of rows is divisible by SLICES_PER_FRAME. +- +-
    PIXEL {FULL | HALF} +- +-
    use half-pixel motion vectors, or just full-pixel ones It is +-usually important that you use half-pixel motion vectors, because it +-results in both better quality and better compression. +- +- +-
    RANGE n +-
    Use a search range of n pixels in each of the four directions +-from a subject pixel. (So the search window is a square n*2 pixels +-on a side). +- +-
    PSEARCH_ALG {EXHAUSTIVE | TWOLEVEL | +- SUBSAMPLE | LOGARITHMIC} +- +-
    This statement tells ppmtompeg what kind of search +- technique (algorithm) to use for P frames. You select the desired +- combination of speed and compression. EXHAUSTIVE gives the +- best compression, but LOGARITHMIC is the fastest. +- TWOLEVEL is an exhaustive full-pixel search, followed by a +- local half- pixel search around the best full-pixel vector (the +- PIXEL option is ignored for this search technique). +- +-
    BSEARCH_ALG {SIMPLE | CROSS2 | EXHAUSTIVE} +- +-
    This statement tells ppmtompeg what kind of search +- technique (algorithm) to use for B frames. SIMPLE means +- find best forward and backward vectors, then interpolate. +- CROSS2 means find those two vectors, then see what backward +- vector best matches the best forward vector, and vice versa. +- EXHAUSTIVE does an n-squared search and is +- extremely slow in relation to the others (CROSS2 +- is about half as fast as SIMPLE). +- +-
    IQSCALE n +-
    Use n as the qscale for I frames. +- See Qscale. +- +-
    PQSCALE n +-
    Use n as the qscale for P frames. +- See Qscale. +- +-
    BQSCALE n +-
    Use n as the qscale for B frames. +- See Qscale. +- +-
    REFERENCE_FRAME {ORIGINAL | DECODED}
    This +-statement determines whether ppmtompeg uses the original images +-or the decoded images when computing motion vectors. Using decoded +-images is more accurate and should increase the playback quality of +-the output, but it makes the encoding take longer and seems to give +-worse compression. It also causes some complications with parallel +-encoding. (see the section on parallel encoding). One thing you can +-do as a trade-off is select ORIGINAL here, and lower the +-qscale (see QSCALE if the quality is not good enough. +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    Original or Decoded? (Normalized)
    ReferenceCompressionSpeedQuality IQuality PQuality B
    Decoded100010001000969919
    Original88513731000912884
    +- +- +- +-
    +- +-

    The following lines are optional: +- +-

    +- +-
    FORCE_ENCODE_LAST_FRAME +- +-
    This statement is obsolete. It does nothing. +- +-

    Before Netpbm 10.26 (January 2005), ppmtompeg would drop +-trailing B frames from your movie, since a movie can't end with a B +-frame. (See I Frames, P Frames, B Frames. +-You would have to specify FORCE_ENCODE_LAST_FRAME to stop +-that from happening and get the same function that ppmtompeg +-has today. +- +- +-

    NIQTABLE +- +-
    This statement specifies a custom non-intra quantization table. +-If you don't specify this statement, ppmtompeg uses a default +-non-intra quantization table. +- +-

    +-The 8 lines immediately following NIQTABLE specify the quantization +-table. Each line defines a table row and consists of 8 integers, +-whitespace-delimited, which define the table columns. +- +-

    IQTABLE +- +-
    This is analogous to NIQTABLE, but for the intra quantization table. +- +-
    ASPECT_RATIO ratio +- +-
    This statement specifies the aspect ratio for ppmtompeg to +-specify in the MPEG output. I'm not sure what this is used for. +- +-

    ratio must be 1.0, 0.6735, 0.7031, 0.7615, 0.8055, 0.8437, +-0.8935, 0.9157, 0.9815, 1.0255, 1.0695, 1.0950, 1.1575, or 1.2015. +- +-

    FRAME_RATE rate +-
    This specifies the frame rate for ppmtompeg to specify in the +-MPEG output. Some players use this value to determine the playback rate. +- +-

    rate must be 23.976, 24, 25, 29.97, 30, 50, 59.94, or 60. +- +-

    BIT_RATE rate +-
    This specifies the bit rate for Constant Bit Rate (CBR) encoding. +- +-

    rate must be an integer. +- +-

    BUFFER_SIZE size +- +-
    This specifies the value +-ppmtompeg is to specify in the MPEG output for the Video +-Buffering Verifier (VBV) buffer size needed to decode the sequence. +- +-

    A Video Verifying Buffer is a buffer in which a decoder keeps the +-decoded bits in order to match the uneven speed of the decoding with +-the required constant playback speed. +- +-

    As ppmtompeg encodes the image, it simulates the decoding +-process in terms of how many bits would be in the VBV as each frame gets +-decoded, assuming a VBV of the size you indicate. +- +-

    If you specify the WARN_VBV_UNDERFLOW statement, +-ppmtompeg issues a warning each time the simulation underflows +-the buffer, which suggests that an underflow would occur on playback, +-which suggests the buffer is too small. +- +-

    If you specify the WARN_VBV_OVERFLOW statement, +-ppmtompeg issues a warning each time the simulation overflows +-the buffer, which suggests that an overflow would occur on playback, +-which suggests the buffer is too small. +- +-

    WARN_VBV_UNDERFLOW +-
    WARN_VBV_OVERFLOW +- +-
    See BUFFER_SIZE. +- +-

    These options were new in Netpbm 10.26 (January 2005). Before that, +-ppmtompeg issued the warnings always. +- +-

    +- +- +-The following statements apply only to parallel operation: +- +-
    +- +-
    PARALLEL +- +-
    This statement, paired with END PARALLEL, is what causes +-ppmtompeg to operate in parallel mode. See Parallel Operation. +- +-
    END PARALLEL +- +-
    This goes with PARALLEL. +- +-
    PARALLEL_TEST_FRAMES n +- +-
    The master starts off by measuring each slave's speed. It does +-this by giving each slave n frames to encode and noting how +-long the slave takes to finish. These are not just test frames, +-though -- they're real frames and the results become part of the +-output. +-ppmtompeg is old and measures time in undivided seconds, so +-to get useful timings, specify enough frames that it will take at +-least 5 seconds to process them. The default is 10. +- +-

    If you specify FORCE_I_ALIGN, ppmtompeg will increase +-the test frames value enough to maintain the alignment. +- +-

    If there aren't enough frames for every slave to have the indicated +-number of test frames, ppmtompeg will give some slaves fewer. +- +- +-

    PARALLEL_TIME_CHUNKS t +- +-
    When you specify this statement, the master attempts to feed work +-to the slaves in chunks that take t seconds to process. It uses +-the speed measurement it made when it started up (see PARALLEL_TEST_FRAMES) +-to decide how many frames to put in the chunk. This statement obviously +-doesn't affect the first batch of work sent to each slave, which is the +-one used to measure the slave's speed. +- +-

    Smaller values of t increase communication, but improve load +-balancing. The default is 30 seconds. +- +-

    You may specify only one of PARALLEL_TIME_CHUNKS, PARALLEL_CHUNK_TAPER, +-and PARALLEL_PERFECT. PARALLEL_CHUNK_TAPER is usually best. +- +-

    PARALLEL_CHUNK_TAPER +- +-
    When you specify this statement, the master distributes work like +-with PARALLEL_TIME_CHUNKS, except that the master chooses the number +-of seconds for the chunks. It starts with a large number and, as it +-gets closer to finishing the job, reduces it. That way, it reduces +-scheduling overhead when precise scheduling isn't helpful, but still +-prevents a slave from finishing early after all the work has already +-been handed out to the other slaves, and then sitting idle while +-there's still work to do. +- +-

    You may specify only one of PARALLEL_TIME_CHUNKS, PARALLEL_CHUNK_TAPER, +-and PARALLEL_PERFECT. PARALLEL_CHUNK_TAPER is usually best. +- +- +-

    PARALLEL_PERFECT +- +-
    If this statement is present, ppmtompeg schedules on the +-assumption that each machine is about the same speed. The master will +-simply divide up the frames evenly between the slaves -- each +-slave gets the same number of frames. If some slaves are faster than +-others, they will finish first and remain idle while the slower slaves +-continue. +- +-

    This has the advantage of minimal scheduling overhead. Where slaves +-have different speeds, though, it makes inefficient use of the fast +-ones. Where slaves are the same speed, it also has the disadvantage +-that they all finish at the same time and feed their output to the +-single Combine Server in a burst, which makes less efficient use of +-the Combine Server and thus can increase the total elapsed time. +- +-

    You may specify only one of PARALLEL_TIME_CHUNKS, PARALLEL_CHUNK_TAPER, +-and PARALLEL_PERFECT. PARALLEL_CHUNK_TAPER is usually best. +- +-

    RSH remote_shell_command +- +-
    ppmtompeg executes the shell command +-remote_shell_command to start a process on another machine. +-The default command is rsh, and whatever command you specify +-must have compatible semantics. ssh is usually compatible. +-The command ppmtompeg uses is one like this: +-ssh remote.host.com -l username shellcommand. +- +-

    Be sure to set up .rhosts files or SSH key authorizations +-where needed. Otherwise, you'll have to type in passwords. +- +-

    On some HP machines, rsh is the restricted shell, and you want +-to specify remsh. +- +-

    FORCE_I_ALIGN +- +-
    This statement forces each slave to encode a chunk of frames which +-is a multiple of the pattern length (see PATTERN). Since the +-first frame in any pattern is an I frame, this forces each chunk +-encoded by a slave to begin with an I frame. +- +-

    This document used to say there was an argument to +-FORCE_I_ALIGN which was the number of frames ppmtompeg +-would use (and was required to be a multiple of the pattern length). +-But ppmtompeg has apparently always ignored that argument, and +-it does now. +- +-

    KEEP_TEMP_FILES +- +-
    This statement causes ppmtompeg not to delete the temporary +-files it uses to transmit encoded frames to the combine server. This +-means you will be left with a file for each frame, the same as you +-would get with the -frames option. +- +-

    This is mostly useful for debugging. +- +-

    This works only if you're using a shared filesystem to communicate +-between the servers. +- +-

    This option was new in Netpbm 10.26 (January 2005). +- +-

    +- +- +-

    Parameter File Notes

    +- +-

    If you use the -combine_gops option, then you need to specify +-only the SIZE and OUTPUT values in the parameter file. In +-addition, the parameter file may specify input GOP files in the same +-manner as normal input files -- except instead of using INPUT_DIR, +-INPUT, and END_INPUT, use GOP_INPUT_DIR, GOP_INPUT, and GOP_END_INPUT. +-If you specify no input GOP files, then ppmtompeg uses by default the +-output file name with suffix .gop.gop_num, with gop_num +-starting from 0, as the input files. +- +-

    If you use the -combine_frames option, then you need to +-specify only the SIZE, GOP_SIZE, and OUTPUT values in the +-parameter file. In addition, the parameter file may specify input +-frame files in the same manner as normal input files -- except instead +-of using INPUT_DIR, INPUT, and END_INPUT, use FRAME_INPUT_DIR, +-FRAME_INPUT, and FRAME_END_INPUT. If no input frame files are +-specified, then the default is to use the output file name with suffix +-.frame.frame_num, with frame_num starting from 0, +-as the input files. +- +-

    Any number of spaces and tabs may come between each option and value. Lines +-beginning with # are ignored. Any other lines are ignored except for +-those between INPUT and END_INPUT. This allows you to use the same +-parameter file for normal usage and for -combine_gops and +--combine_frames. +- +-

    The file format is case-sensitive so all keywords should be in +-upper case. +- +-

    The statements may appear in any order, except that the order within +-a block statement (such as INPUT ... END INPUT) is significant. +- +-

    ppmtompeg is prepared to handle up to 16 B frames between +-reference frames when encoding with input from stdin. (To build a +-modified ppmtompeg with a higher limit, change the constant +-B_FRAME_RUN in frame.c and recompile). +- +-

    GENERAL USAGE INFORMATION

    +- +-

    Qscale

    +- +-

    The quantization scale values (qscale) give a trade-off between +-quality and compression. Using different Qscale values has very little +-effect on speed. The qscale values can be set separately for I, P, and +-B frames. +- +-

    You select the qscale values with the IQSCALE, +-PQSCALE, and BSCALE parameter file statements. +- +-

    A qscale value is an integer from 1 to 31. Larger numbers give +-better compression, but worse quality. In the following, the quality +-numbers are peak signal-to-noise ratio, defined as: +-signal-to-noise formula +-where MSE is the mean squared error. +- +- +-

    Flower garden tests: +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    Qscale vs Quality
    QscaleI FramesP FramesB Frames
    143.246.346.5
    632.634.634.3
    1128.629.530.0
    1626.326.828.6
    2124.725.027.9
    2623.523.927.5
    3122.623.027.3
    +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    Qscale vs Compression
    QscaleI FramesP FramesB Frames
    1222
    671015
    11111843
    16152997
    211941173
    262456256
    312873330
    +- +- +-

    Search Techniques

    +- +-

    There are several different motion vector search techniques +-available. There are different techniques available for P frame +-search and B frame search. Using different search techniques present +-little difference in quality, but a large difference in compression +-and speed. +- +-

    There are 4 types of P frame search: Exhaustive, TwoLevel, +-SubSample, and Logarithmic. +- +-

    There are 3 types of B frame search: Exhaustive, Cross2, and +-Simple. +- +-The recommended search techniques are TwoLevel and Logarithmic for +-P frame search, and Cross2 and Simple for B frame search. Here are +-some numbers comparing the different search methods: +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    P frame Motion Vector Search (Normalized)
    TechniqueCompression1Speed 2Quality 3
    Exhaustive100010001000
    SubSample100824561000
    TwoLevel100932371000
    Logarithmic10858229998
    +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    B frame Motion Vector Search (Normalized)
    TechniqueCompression1Speed2Quality3
    Exhaustive100010001000
    Cross29751000996
    Simple9381765991
    +- +- 1Smaller numbers are better +-compression. +- +- 2Larger numbers mean faster +-execution. +- +- 3Larger numbers mean better quality. +- +-

    For some reason, Simple seems to give better compression, but it +-depends on the image sequence. +- +-

    Select the search techniques with the PSEARCH_ALG and +-BSEARCH_ALG parameter file statements. +- +- +- +-

    Group Of Pictures (GOP)

    +- +-

    A Group of Pictures (GOP) is a roughly independently decodable +-sequence of frames. An MPEG video stream is made of one or more +-GOP's. You may specify how many frames should be in each GOP with the +-GOP_SIZE parameter file statement. A GOP always starts with an +-I frame. +- +-

    Instead of encoding an entire sequence, you can encode a single +-GOP. To do this, use the -gop command option. You can later +-join the resulting GOP files at any time by running ppmtompeg +-with the -combine_gops command option. +- +- +-

    Slices

    +- +-

    A slice is an independently decodable unit in a frame. It can be +-as small as one macroblock, or it can be as big as the entire frame. +-Barring transmission error, adding slices does not change quality or +-speed; the only effect is slightly worse compression. More slices are +-used for noisy transmission so that errors are more recoverable. Since +-usually errors are not such a problem, we usually just use one slice +-per frame. +- +-

    Control the slice size with the SLICES_PER_FRAME parameter +-file statement. +- +-

    Some MPEG playback systems require that each slice consist of whole +-rows of macroblocks. If you are encoding for this kind of player, if +-the height of the image is H pixels, then you should set the +-SLICES_PER_FRAME to some number which divides H/16. For example, if +-the image is 240 pixels (15 macroblocks) high, then you should use +-only 15, 5, 3, or 1 slices per frame. +- +-

    Note: these MPEG playback systems are really wrong, since the MPEG +-standard says this doesn't have to be so. +- +- +- +-

    Search Window

    +- +-

    The search window is the window in which ppmtompeg searches +-for motion vectors. The window is a square. You can specify the size +-of the square, and whether to allow half-pixel motion vectors or not, +-with the RANGE and PIXEL parameter file statements. +- +-

    I Frames, P Frames, B Frames

    +- +-

    In MPEG-1, a movie is represented as a sequence of MPEG frames, +-each of which is an I Frame, a P Frame, or a B Frame. Each represents +-an actual frame of the movie (don't get confused by the dual use of +-the word "frame." A movie frame is a graphical image. An MPEG frame +-is a set of data that describes a movie frame). +- +-

    An I frame ("intra" frame) describes a movie frame in isolation -- +-without respect to any other frame in the movie. A P frame +-("predictive" frame) describes a movie frame by describing how it +-differs from the movie frame described by the latest preceding I or +-P frame. A B frame ("bidirectional" frame) describes a movie frame by +-describing how it differs from the movie frames described by the +-nearest I or P frame before and after it. +- +-

    Note that the first frame of a movie must be described by an I +-frame (because there is no previous movie frame) and the last movie +-frame must be described by an I or P frame (because there is no +-subsequent movie frame). +- +-

    Beyond that, you can choose which frames are represented by which +-types. You specify a pattern, such as IBPBP and ppmtompeg +-simply repeats it over and over throughout the movie. The pattern +-affects speed, quality, and stream size. Here is a chart which shows +-some of the trade-offs: +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    Comparison of I/P/B Frames (Normalized)
    Frame TypeSizeSpeedQuality
    I frames100010001000
    P frames409609969
    B frames72260919
    +- +-(this is with constant qscale) +- +-

    A standard sequence is IBBPBBPBBPBBPBB. +- +-

    Select the sequence with the PATTERN parameter file statement. +- +-

    Since the last MPEG frame cannot be a B frame (see above), if the +-pattern you specify indicates a B frame for the last movie frame of +-the movie, ppmtompeg makes it an I frame instead. +- +-

    Before Netpbm 10.26 (January 2005), ppmtompeg instead drops +-the trailing B frames by default, and you need the +-FORCE_ENCODE_LAST_FRAME parameter file statement to make it do +-this. +- +-

    The MPEG frames don't appear in the MPEG-1 stream in the same order that +-the corresponding movie frames appear in the movie -- the B frames come after +-the I and P frames on which they are based. For example, if the movie is +-4 frames that you will represent with the pattern IBBP, the MPEG-1 stream +-will start with an I frame describing movie frame 0. The next frame in +-the MPEG-1 stream is a P frame describing movie frame 3. The last two +-frames in the MPEG-1 stream are B frames describing movie frames 1 and 2, +-respectively. +- +- +-

    Specifying Input and Output Files

    +- +-

    Specify the input frame images with the INPUT_DIR, +-INPUT, END_INPUT, BASE_FILE_FORMAT, +-SIZE, YUV_FORMAT and INPUT_CONVERT parameter +-file statements. +- +-

    Specify the output file with the OUTPUT parameter file statement. +- +- +-

    Statistics

    +- +-

    ppmtompeg can generate a variety of statistics about the +-encoding. See the -stat, -snr, -mv_histogram, +--quiet, -no_frame_summary, and -bit_rate_info +-options. +- +- +-

    PARALLEL OPERATION

    +- +-

    You can run ppmtompeg on multiple machines at once, encoding +-the same MPEG stream. When you do, the machines are used as shown in +-the following diagram. We call this "parallel mode." +- +-

    ppmtompeg-par.gif +- +-

    To do parallel processing, put the statement +- +-

    +-    PARALLEL
    +-
    +- +-in the parameter file, followed by a listing of the machines, one +-machine per line, then +- +-
    +-    END_PARALLEL
    +-
    +- +-Each of the machine lines must be in one of two forms. If the machine +-has filesystem access to the input files, then the line is: +- +-

    +-machine user executable +- +-

    The executable is normally ppmtompeg (you may need to give +-the complete path if you've built for different architectures). If +-the machine does not have filesystem access to the input files, the line +-is: +- +-

    REMOTE machine user executable +-parameter file +- +-

    The -max_machines command option limits the number of +-machines ppmtompeg will use. If you specify more machines in +-the parameter file than -max_machines allows, ppmtompeg +-uses only the machines listed first. This is handy if you want to +-experiment with different amounts of parallelism. +- +-

    In general, you should use full path file names when describing +-executables and parameter files. This includes the parameter +-file argument on the original invocation of ppmtompeg. +- +-

    All file names must be the same on all systems (so if e.g. you're +-using an NFS filesystem, you must make sure it is mounted at the same +-mountpoint on all systems). +- +-

    Because not all of the processes involved in parallel operation +-have easy access to the input files, you must specify the SIZE +-parameter file statement when you do parallel operation. +- +-

    The machine on which you originally invoke ppmtompeg is the +-master machine. It hosts a "combine server,", a +-"decode server," and a number of "i/o servers," +-all as separate processes. The other machines in the network (listed +-in the parameter file) are slave machines. Each hosts a single +-process that continuously requests work from the master and does it. +-The slave process does the computation to encode MPEG frames. It +-processes frames in batches identified by the master. +- +-

    The master uses a remote shell command to start a process on a +-slave machine. By default, it uses an rsh shell command to do +-this. But use the RSH parameter file statement to control +-this. The shell command the master executes remotely is +-ppmtompeg, but with options to indicate that it is to perform +-slave functions. +- +-

    The various machines talk to each other over TCP connections. Each +-machine finds and binds to a free TCP port number and tells its +-partners the port number. These port numbers are at least 2048. +- +-

    Use the PARALLEL_TEST_FRAMES, PARALLEL_TIME_CHUNKS, and +-PARALLEL_PERFECT parameter file statements to control the way the +-master divides up work among the slaves. +- +-

    Use the -nice command option to cause all slave processes to run +-"nicely," i.e. as low priority processes. That way, this substantial and +-long-running CPU load will have minimal impact on other, possibly +-interactive, users of the systems. +- +-  +-

    SPEED

    +- +-

    Here is a look at ppmtompeg speed, in single-node (not parallel) +-operation: +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    Compression Speed
    Machine TypeMacroblocks per second1
    HP 9000/755280
    DEC 3000/400247
    HP 9000/750191
    Sparc 10104
    DEC 500068
    +-1A macroblock is a 16x16 pixel square +- +-

    The measurements in the table are with inputs and outputs via a +-conventional locally attached filesystem. If you are using a network +-filesystem over a single 10 MB/s Ethernet, that constrains your speed more +-than your CPU speed. In that case, don't expect to get better than 4 +-or 5 frames per second no matter how fast your CPUs are. +- +-

    Network speed is even more of a bottleneck when the slaves do not +-have filesystem access to the input files -- i.e. you declare them +-REMOTE. +- +-

    Where I/O is the bottleneck, size of the input frames can make a big +-difference. So YUV input is better than PPM, and JPEG is better than +-both. +- +-

    When you're first trying to get parallel mode working, be sure to +-use the -debug_machines option so you can see what's going on. +-Also, -debug_sockets can help you diagnose communication +-problems. +- +- +-

    AUTHORS

    +- +- +- +-
    +-  +-

    Table Of Contents

    +- +- +- diff --git a/SOURCES/netpbm-multilib.patch b/SOURCES/netpbm-multilib.patch new file mode 100644 index 0000000..ea689bc --- /dev/null +++ b/SOURCES/netpbm-multilib.patch @@ -0,0 +1,11 @@ +diff -up netpbm-10.47.04/buildtools/endiangen.c.multilib netpbm-10.47.04/buildtools/endiangen.c +--- netpbm-10.47.04/buildtools/endiangen.c.multilib 2009-10-21 13:38:54.000000000 +0200 ++++ netpbm-10.47.04/buildtools/endiangen.c 2009-10-21 14:35:58.000000000 +0200 +@@ -87,7 +87,6 @@ main(int argc, char **argv) { + byteOrder() == ENDIAN_LITTLE ? "LITTLE_ENDIAN" : "BIG_ENDIAN"); + printf("#endif\n"); + printf("\n"); +- printf("#define BITS_PER_LONG %u\n", bitsPerLong()); + + return 0; + } diff --git a/SOURCES/netpbm-noppmtompeg.patch b/SOURCES/netpbm-noppmtompeg.patch new file mode 100644 index 0000000..f5fbd57 --- /dev/null +++ b/SOURCES/netpbm-noppmtompeg.patch @@ -0,0 +1,13 @@ +diff --git a/converter/ppm/Makefile b/converter/ppm/Makefile +index b97349d..f68170f 100644 +--- a/converter/ppm/Makefile ++++ b/converter/ppm/Makefile +@@ -7,7 +7,7 @@ VPATH=.:$(SRCDIR)/$(SUBDIR) + + include $(BUILDDIR)/config.mk + +-SUBDIRS = hpcdtoppm ppmtompeg ++SUBDIRS = hpcdtoppm + + PORTBINARIES = 411toppm eyuvtoppm gouldtoppm ilbmtoppm imgtoppm \ + leaftoppm mtvtoppm neotoppm \ diff --git a/SOURCES/netpbm-pamtojpeg2k.patch b/SOURCES/netpbm-pamtojpeg2k.patch new file mode 100644 index 0000000..9615ce7 --- /dev/null +++ b/SOURCES/netpbm-pamtojpeg2k.patch @@ -0,0 +1,11 @@ +diff -up netpbm-10.47.12/converter/other/jpeg2000/pamtojpeg2k.c.pamtojpeg2kfix netpbm-10.47.12/converter/other/jpeg2000/pamtojpeg2k.c +--- netpbm-10.47.12/converter/other/jpeg2000/pamtojpeg2k.c.pamtojpeg2kfix 2010-04-27 15:47:10.000000000 +0200 ++++ netpbm-10.47.12/converter/other/jpeg2000/pamtojpeg2k.c 2010-05-03 15:37:49.934269588 +0200 +@@ -518,7 +518,5 @@ main(int argc, char **argv) + + pm_close(ifP); + +- pm_close(stdout); +- + return 0; + } diff --git a/SOURCES/netpbm-ppmfadeusage.patch b/SOURCES/netpbm-ppmfadeusage.patch new file mode 100644 index 0000000..d48f5f5 --- /dev/null +++ b/SOURCES/netpbm-ppmfadeusage.patch @@ -0,0 +1,57 @@ +diff -urNp old/editor/ppmfade new/editor/ppmfade +--- old/editor/ppmfade 2017-11-01 11:47:49.869611402 +0100 ++++ new/editor/ppmfade 2017-11-01 11:53:25.524973342 +0100 +@@ -84,7 +84,7 @@ for ($n = 0; $n < @ARGV; $n++) { + if (-e $first_file) { + } else { + print "I can't find first file '$first_file'\n"; +- exit 20; ++ exit 1; + } + } elsif ($ARGV[$n] eq "-l") { + $n++; +@@ -92,7 +92,7 @@ for ($n = 0; $n < @ARGV; $n++) { + if (-e $last_file) { + } else { + print "I can't find last file '$last_file'\n"; +- exit 20; ++ exit 1; + } + } elsif ($ARGV[$n] eq "-base") { + $n++; +@@ -113,9 +113,12 @@ for ($n = 0; $n < @ARGV; $n++) { + $mode = $BLOCK; + } elsif ("$ARGV[$n]" eq "-mix") { + $mode = $MIX; ++ } elsif ($ARGV[$n] eq "-help" || $ARGV[$n] eq "--help" || $ARGV[$n] eq "-h") { ++ print "ppmfade: Use 'man ppmfade' for help.\n"; ++ exit 1; + } else { + print "Unknown argument: $ARGV[$n]\n"; +- exit 100; ++ exit 1; + } + } + # +@@ -134,18 +137,18 @@ if ($first_file ne "undefined") { + $width = $1; $height = $2; + } else { + print("Unrecognized results from pnmfile on $first_file.\n"); +- exit(50); ++ exit 1; + } + } elsif ($last_file ne "undefined") { + if ((`pnmfile $last_file` =~ m{\b(\d+)\sby\s(\d+)} )) { + $width = $1; $height = $2; + } else { + print("Unrecognized results from pnmfile on $first_file.\n"); +- exit(50); ++ exit 1; + } + } else { + print("ppmfade: You must specify -f or -l (or both)\n"); +- exit(90); ++ exit 1; + } + + print("Frames are " . $width . "W x " . $height . "H\n"); diff --git a/SOURCES/netpbm-security-code.patch b/SOURCES/netpbm-security-code.patch new file mode 100644 index 0000000..faf7237 --- /dev/null +++ b/SOURCES/netpbm-security-code.patch @@ -0,0 +1,1603 @@ +diff --git a/analyzer/pgmtexture.c b/analyzer/pgmtexture.c +index 84c6bf4..c9576f5 100644 +--- a/analyzer/pgmtexture.c ++++ b/analyzer/pgmtexture.c +@@ -98,6 +98,8 @@ vector(unsigned int const nl, + + assert(nh >= nl); + ++ overflow_add(nh - nl, 1); ++ + MALLOCARRAY(v, (unsigned) (nh - nl + 1)); + + if (v == NULL) +@@ -129,6 +131,7 @@ matrix (unsigned int const nrl, + assert(nrh >= nrl); + + /* allocate pointers to rows */ ++ overflow_add(nrh - nrl, 1); + MALLOCARRAY(m, (unsigned) (nrh - nrl + 1)); + if (m == NULL) + pm_error("Unable to allocate memory for a matrix."); +@@ -137,6 +140,7 @@ matrix (unsigned int const nrl, + + assert (nch >= ncl); + ++ overflow_add(nch - ncl, 1); + /* allocate rows and set pointers to them */ + for (i = nrl; i <= nrh; ++i) { + MALLOCARRAY(m[i], (unsigned) (nch - ncl + 1)); +diff --git a/converter/other/gemtopnm.c b/converter/other/gemtopnm.c +index aac7479..5f1a51a 100644 +--- a/converter/other/gemtopnm.c ++++ b/converter/other/gemtopnm.c +@@ -106,6 +106,7 @@ main(argc, argv) + + pnm_writepnminit( stdout, cols, rows, MAXVAL, type, 0 ); + ++ overflow_add(cols, padright); + { + /* allocate input row data structure */ + int plane; +diff --git a/converter/other/jpegtopnm.c b/converter/other/jpegtopnm.c +index 98552c0..311298c 100644 +--- a/converter/other/jpegtopnm.c ++++ b/converter/other/jpegtopnm.c +@@ -862,6 +862,8 @@ convertImage(FILE * const ofP, + /* Calculate output image dimensions so we can allocate space */ + jpeg_calc_output_dimensions(cinfoP); + ++ overflow2(cinfoP->output_width, cinfoP->output_components); ++ + /* Start decompressor */ + jpeg_start_decompress(cinfoP); + +diff --git a/converter/other/pbmtopgm.c b/converter/other/pbmtopgm.c +index 69b20fb..382a487 100644 +--- a/converter/other/pbmtopgm.c ++++ b/converter/other/pbmtopgm.c +@@ -47,6 +47,7 @@ main(int argc, char *argv[]) { + "than the image height (%u rows)", height, rows); + + outrow = pgm_allocrow(cols) ; ++ overflow2(width, height); + maxval = MIN(PGM_OVERALLMAXVAL, width*height); + pgm_writepgminit(stdout, cols, rows, maxval, 0) ; + +diff --git a/converter/other/pnmtoddif.c b/converter/other/pnmtoddif.c +index ac02e42..a2f045b 100644 +--- a/converter/other/pnmtoddif.c ++++ b/converter/other/pnmtoddif.c +@@ -629,6 +629,7 @@ main(int argc, char *argv[]) { + switch (PNM_FORMAT_TYPE(format)) { + case PBM_TYPE: + ip.bits_per_pixel = 1; ++ overflow_add(cols, 7); + ip.bytes_per_line = (cols + 7) / 8; + ip.spectral = 2; + ip.components = 1; +@@ -644,6 +645,7 @@ main(int argc, char *argv[]) { + ip.polarity = 2; + break; + case PPM_TYPE: ++ overflow2(cols, 3); + ip.bytes_per_line = 3 * cols; + ip.bits_per_pixel = 24; + ip.spectral = 5; +diff --git a/converter/other/pnmtojpeg.c b/converter/other/pnmtojpeg.c +index 4482624..757d08d 100644 +--- a/converter/other/pnmtojpeg.c ++++ b/converter/other/pnmtojpeg.c +@@ -606,7 +606,11 @@ read_scan_script(j_compress_ptr const cinfo, + want JPOOL_PERMANENT. + */ + const unsigned int scan_info_size = nscans * sizeof(jpeg_scan_info); +- jpeg_scan_info * const scan_info = ++ const jpeg_scan_info * scan_info; ++ ++ overflow2(nscans, sizeof(jpeg_scan_info)); ++ ++ scan_info = + (jpeg_scan_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + scan_info_size); +@@ -938,6 +942,8 @@ compute_rescaling_array(JSAMPLE ** const rescale_p, const pixval maxval, + const long half_maxval = maxval / 2; + long val; + ++ overflow_add(maxval, 1); ++ overflow2(maxval+1, sizeof(JSAMPLE)); + *rescale_p = (JSAMPLE *) + (cinfo.mem->alloc_small) ((j_common_ptr) &cinfo, JPOOL_IMAGE, + (size_t) (((long) maxval + 1L) * +@@ -1016,6 +1022,7 @@ convert_scanlines(struct jpeg_compress_struct * const cinfo_p, + */ + + /* Allocate the libpnm output and compressor input buffers */ ++ overflow2(cinfo_p->image_width, cinfo_p->input_components); + buffer = (*cinfo_p->mem->alloc_sarray) + ((j_common_ptr) cinfo_p, JPOOL_IMAGE, + (unsigned int) cinfo_p->image_width * cinfo_p->input_components, +diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c +index de0dfd8..09c28d5 100644 +--- a/converter/other/pnmtops.c ++++ b/converter/other/pnmtops.c +@@ -294,17 +294,21 @@ parseCommandLine(int argc, const char ** argv, + validateCompDimension(width, 72, "-width value"); + validateCompDimension(height, 72, "-height value"); + ++ overflow2(width, 72); + cmdlineP->width = width * 72; ++ overflow2(height, 72); + cmdlineP->height = height * 72; + + if (imagewidthSpec) { + validateCompDimension(imagewidth, 72, "-imagewidth value"); ++ overflow2(imagewidth, 72); + cmdlineP->imagewidth = imagewidth * 72; + } + else + cmdlineP->imagewidth = 0; + if (imageheightSpec) { +- validateCompDimension(imagewidth, 72, "-imageheight value"); ++ validateCompDimension(imageheight, 72, "-imageheight value"); ++ overflow2(imageheight, 72); + cmdlineP->imageheight = imageheight * 72; + } + else +diff --git a/converter/other/rletopnm.c b/converter/other/rletopnm.c +index 018456c..35ea7f7 100644 +--- a/converter/other/rletopnm.c ++++ b/converter/other/rletopnm.c +@@ -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, + * and the reason for such modification. ++ * ++ * 2002-12-19: Fix maths wrapping bugs. Alan Cox + */ + /* + * rletopnm - A conversion program to convert from Utah's "rle" image format +diff --git a/converter/other/sirtopnm.c b/converter/other/sirtopnm.c +index fafcc91..9fe49d0 100644 +--- a/converter/other/sirtopnm.c ++++ b/converter/other/sirtopnm.c +@@ -69,6 +69,7 @@ char* argv[]; + } + break; + case PPM_TYPE: ++ overflow3(cols, rows, 3); + picsize = cols * rows * 3; + planesize = cols * rows; + if ( !( sirarray = (unsigned char*) malloc( picsize ) ) ) +diff --git a/converter/other/tifftopnm.c b/converter/other/tifftopnm.c +index c1e7af8..ef9253b 100644 +--- a/converter/other/tifftopnm.c ++++ b/converter/other/tifftopnm.c +@@ -1372,7 +1372,9 @@ convertRasterByRows(pnmOut * const pnmOutP, + if (scanbuf == NULL) + pm_error("can't allocate memory for scanline buffer"); + +- MALLOCARRAY(samplebuf, cols * spp); ++ /* samplebuf is unsigned int * !!! */ ++ samplebuf = (unsigned int *) malloc3(cols , sizeof(unsigned int) , spp); ++ + if (samplebuf == NULL) + pm_error("can't allocate memory for row buffer"); + +diff --git a/converter/other/xwdtopnm.c b/converter/other/xwdtopnm.c +index df3c737..6c19ade 100644 +--- a/converter/other/xwdtopnm.c ++++ b/converter/other/xwdtopnm.c +@@ -210,6 +210,10 @@ processX10Header(X10WDFileHeader * const h10P, + *colorsP = pnm_allocrow(2); + PNM_ASSIGN1((*colorsP)[0], 0); + PNM_ASSIGN1((*colorsP)[1], *maxvalP); ++ overflow_add(h10P->pixmap_width, 15); ++ if(h10P->pixmap_width < 0) ++ pm_error("assert: negative width"); ++ overflow2((((h10P->pixmap_width + 15) / 16) * 16 - h10P->pixmap_width), 8); + *padrightP = + (((h10P->pixmap_width + 15) / 16) * 16 - h10P->pixmap_width) * 8; + *bits_per_itemP = 16; +@@ -635,6 +639,7 @@ processX11Header(X11WDFileHeader * const h11P, + + *colsP = h11FixedP->pixmap_width; + *rowsP = h11FixedP->pixmap_height; ++ overflow2(h11FixedP->bytes_per_line, 8); + *padrightP = + h11FixedP->bytes_per_line * 8 - + h11FixedP->pixmap_width * h11FixedP->bits_per_pixel; +diff --git a/converter/pbm/mdatopbm.c b/converter/pbm/mdatopbm.c +index d8e0657..12c7468 100644 +--- a/converter/pbm/mdatopbm.c ++++ b/converter/pbm/mdatopbm.c +@@ -245,10 +245,13 @@ main(int argc, char **argv) { + pm_readlittleshort(infile, &yy); nInCols = yy; + } + ++ overflow2(nOutCols, 8); + nOutCols = 8 * nInCols; + nOutRows = nInRows; +- if (bScale) ++ if (bScale) { ++ overflow2(nOutRows, 2); + nOutRows *= 2; ++ } + + data = pbm_allocarray(nOutCols, nOutRows); + +diff --git a/converter/pbm/mgrtopbm.c b/converter/pbm/mgrtopbm.c +index 9f7004a..60e8477 100644 +--- a/converter/pbm/mgrtopbm.c ++++ b/converter/pbm/mgrtopbm.c +@@ -65,6 +65,8 @@ readMgrHeader(FILE * const ifP, + if (head.h_high < ' ' || head.l_high < ' ') + pm_error("Invalid width field in MGR header"); + ++ overflow_add(*colsP, pad); ++ + *colsP = (((int)head.h_wide - ' ') << 6) + ((int)head.l_wide - ' '); + *rowsP = (((int)head.h_high - ' ') << 6) + ((int) head.l_high - ' '); + *padrightP = ( ( *colsP + pad - 1 ) / pad ) * pad - *colsP; +diff --git a/converter/pbm/pbmto4425.c b/converter/pbm/pbmto4425.c +index 1d97ac6..c4c8cbb 100644 +--- a/converter/pbm/pbmto4425.c ++++ b/converter/pbm/pbmto4425.c +@@ -2,6 +2,7 @@ + + #include "nstring.h" + #include "pbm.h" ++#include + + static char bit_table[2][3] = { + {1, 4, 0x10}, +@@ -160,7 +161,7 @@ main(int argc, char * argv[]) { + xres = vmap_width * 2; + yres = vmap_height * 3; + +- vmap = malloc(vmap_width * vmap_height * sizeof(char)); ++ vmap = malloc3(vmap_width, vmap_height, sizeof(char)); + if(vmap == NULL) + { + pm_error( "Cannot allocate memory" ); +diff --git a/converter/pbm/pbmtogem.c b/converter/pbm/pbmtogem.c +index 9eab041..13b0257 100644 +--- a/converter/pbm/pbmtogem.c ++++ b/converter/pbm/pbmtogem.c +@@ -79,6 +79,7 @@ putinit (int const rows, int const cols) + bitsperitem = 0; + bitshift = 7; + outcol = 0; ++ overflow_add(cols, 7); + outmax = (cols + 7) / 8; + outrow = (unsigned char *) pm_allocrow (outmax, sizeof (unsigned char)); + lastrow = (unsigned char *) pm_allocrow (outmax, sizeof (unsigned char)); +diff --git a/converter/pbm/pbmtogo.c b/converter/pbm/pbmtogo.c +index 23b2ee9..d2ee91f 100644 +--- a/converter/pbm/pbmtogo.c ++++ b/converter/pbm/pbmtogo.c +@@ -158,6 +158,7 @@ main(int argc, + bitrow = pbm_allocrow(cols); + + /* Round cols up to the nearest multiple of 8. */ ++ overflow_add(cols, 7); + rucols = ( cols + 7 ) / 8; + bytesperrow = rucols; /* GraphOn uses bytes */ + rucols = rucols * 8; +diff --git a/converter/pbm/pbmtolj.c b/converter/pbm/pbmtolj.c +index 0cceb4f..fdab6df 100644 +--- a/converter/pbm/pbmtolj.c ++++ b/converter/pbm/pbmtolj.c +@@ -120,7 +120,11 @@ parseCommandLine(int argc, char ** argv, + static void + allocateBuffers(unsigned int const cols) { + ++ overflow_add(cols, 8); + rowBufferSize = (cols + 7) / 8; ++ overflow_add(rowBufferSize, 128); ++ overflow_add(rowBufferSize, rowBufferSize+128); ++ overflow_add(rowBufferSize+10, rowBufferSize/8); + packBufferSize = rowBufferSize + (rowBufferSize + 127) / 128 + 1; + deltaBufferSize = rowBufferSize + rowBufferSize / 8 + 10; + +diff --git a/converter/pbm/pbmtomda.c b/converter/pbm/pbmtomda.c +index 3ad5149..9efe5cf 100644 +--- a/converter/pbm/pbmtomda.c ++++ b/converter/pbm/pbmtomda.c +@@ -179,6 +179,7 @@ int main(int argc, char **argv) + + nOutRowsUnrounded = bScale ? nInRows/2 : nInRows; + ++ overflow_add(nOutRowsUnrounded, 3); + nOutRows = ((nOutRowsUnrounded + 3) / 4) * 4; + /* MDA wants rows a multiple of 4 */ + nOutCols = nInCols / 8; +diff --git a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c +index 2f8a42b..1c8d236 100644 +--- a/converter/pbm/pbmtoppa/pbm.c ++++ b/converter/pbm/pbmtoppa/pbm.c +@@ -106,6 +106,7 @@ int pbm_readline(pbm_stat* pbm,unsigned char* data) + return 0; + + case P4: ++ overflow_add(pbm->width, 7); + tmp=(pbm->width+7)/8; + tmp2=fread(data,1,tmp,pbm->fptr); + if(tmp2 == tmp) +@@ -130,6 +131,7 @@ void pbm_unreadline (pbm_stat *pbm, void *data) + return; + + pbm->unread = 1; ++ overflow_add(pbm->width, 7); + pbm->revdata = malloc ((pbm->width+7)/8); + memcpy (pbm->revdata, data, (pbm->width+7)/8); + pbm->current_line--; +diff --git a/converter/pbm/pbmtoppa/pbmtoppa.c b/converter/pbm/pbmtoppa/pbmtoppa.c +index ff4a599..aa510ec 100644 +--- a/converter/pbm/pbmtoppa/pbmtoppa.c ++++ b/converter/pbm/pbmtoppa/pbmtoppa.c +@@ -453,6 +453,7 @@ main(int argc, char *argv[]) { + pm_error("main(): unrecognized parameter '%s'", argv[argn]); + } + ++ overflow_add(Width, 7); + Pwidth=(Width+7)/8; + printer.fptr=out; + +diff --git a/converter/pbm/pbmtoxbm.c b/converter/pbm/pbmtoxbm.c +index ecb72b3..fc0eb9c 100644 +--- a/converter/pbm/pbmtoxbm.c ++++ b/converter/pbm/pbmtoxbm.c +@@ -352,6 +352,8 @@ convertRaster(FILE * const ifP, + + unsigned char * bitrow; + unsigned int row; ++ ++ overflow_add(cols, padright); + + putinit(xbmVersion); + +diff --git a/converter/pbm/pktopbm.c b/converter/pbm/pktopbm.c +index 712f339..b6fcb02 100644 +--- a/converter/pbm/pktopbm.c ++++ b/converter/pbm/pktopbm.c +@@ -280,6 +280,7 @@ main(int argc, char *argv[]) { + if (flagbyte == 7) { /* long form preamble */ + integer packetlength = get32() ; /* character packet length */ + car = get32() ; /* character number */ ++ overflow_add(packetlength, pktopbm_pkloc); + endofpacket = packetlength + pktopbm_pkloc; + /* calculate end of packet */ + if ((car >= MAXPKCHAR) || !filename[car]) { +diff --git a/converter/pbm/thinkjettopbm.l b/converter/pbm/thinkjettopbm.l +index 5de4f2b..7f31de5 100644 +--- a/converter/pbm/thinkjettopbm.l ++++ b/converter/pbm/thinkjettopbm.l +@@ -114,7 +114,9 @@ DIG [0-9] + \033\*b{DIG}+W { + int l; + if (rowCount >= rowCapacity) { +- rowCapacity += 100; ++ overflow_add(rowCapacity, 100); ++ rowCapacity += 100; ++ overflow2(rowCapacity, sizeof *rows); + rows = realloc (rows, rowCapacity * sizeof *rows); + if (rows == NULL) + pm_error ("Out of memory."); +@@ -226,6 +228,8 @@ yywrap (void) + /* + * Quite simple since ThinkJet bit arrangement matches PBM + */ ++ ++ overflow2(maxRowLength, 8); + pbm_writepbminit(stdout, maxRowLength*8, rowCount, 0); + + packed_bitrow = malloc(maxRowLength); +diff --git a/converter/pbm/ybmtopbm.c b/converter/pbm/ybmtopbm.c +index 2a42908..cf1ff03 100644 +--- a/converter/pbm/ybmtopbm.c ++++ b/converter/pbm/ybmtopbm.c +@@ -43,6 +43,7 @@ getinit(FILE * const ifP, + pm_error("EOF / read error"); + + *depthP = 1; ++ overflow_add(*colsP, 15); + } + + +diff --git a/converter/pgm/lispmtopgm.c b/converter/pgm/lispmtopgm.c +index 40dd3fb..b5469f7 100644 +--- a/converter/pgm/lispmtopgm.c ++++ b/converter/pgm/lispmtopgm.c +@@ -58,6 +58,7 @@ main( argc, argv ) + pm_error( "depth (%d bits) is too large", depth); + + pgm_writepgminit( stdout, cols, rows, (gray) maxval, 0 ); ++ overflow_add(cols, 7); + grayrow = pgm_allocrow( ( cols + 7 ) / 8 * 8 ); + + for ( row = 0; row < rows; ++row ) +@@ -102,6 +103,8 @@ getinit( file, colsP, rowsP, depthP, padrightP ) + + if ( *depthP == 0 ) + *depthP = 1; /* very old file */ ++ ++ overflow_add((int)colsP, 31); + + *padrightP = ( ( *colsP + 31 ) / 32 ) * 32 - *colsP; + +diff --git a/converter/pgm/psidtopgm.c b/converter/pgm/psidtopgm.c +index 07417d1..25bb311 100644 +--- a/converter/pgm/psidtopgm.c ++++ b/converter/pgm/psidtopgm.c +@@ -78,6 +78,7 @@ main(int argc, + pm_error("bits/sample (%d) is too large.", bitspersample); + + pgm_writepgminit(stdout, cols, rows, maxval, 0); ++ overflow_add(cols, 7); + grayrow = pgm_allocrow((cols + 7) / 8 * 8); + for (row = 0; row < rows; ++row) { + unsigned int col; +diff --git a/converter/ppm/Makefile b/converter/ppm/Makefile +index 003ef8d..b97349d 100644 +--- a/converter/ppm/Makefile ++++ b/converter/ppm/Makefile +@@ -11,7 +11,7 @@ SUBDIRS = hpcdtoppm ppmtompeg + + PORTBINARIES = 411toppm eyuvtoppm gouldtoppm ilbmtoppm imgtoppm \ + leaftoppm mtvtoppm neotoppm \ +- pcxtoppm pc1toppm pi1toppm picttoppm pjtoppm \ ++ pcxtoppm pc1toppm pi1toppm pjtoppm \ + ppmtoacad ppmtoapplevol ppmtoarbtxt ppmtoascii \ + ppmtobmp ppmtoeyuv ppmtogif ppmtoicr ppmtoilbm \ + ppmtoleaf ppmtolj ppmtomitsu ppmtoneo \ +diff --git a/converter/ppm/ilbmtoppm.c b/converter/ppm/ilbmtoppm.c +index 662be0b..2a86efc 100644 +--- a/converter/ppm/ilbmtoppm.c ++++ b/converter/ppm/ilbmtoppm.c +@@ -606,6 +606,7 @@ decode_row(FILE * const ifP, + rawtype *chp; + + cols = bmhdP->w; ++ overflow_add(cols, 15); + bytes = RowBytes(cols); + for( plane = 0; plane < nPlanes; plane++ ) { + int mask; +@@ -693,6 +694,23 @@ decode_mask(FILE * const ifP, + Multipalette handling + ****************************************************************************/ + ++static void * ++xmalloc2(x, y) ++ int x; ++ int y; ++{ ++ void *mem; ++ ++ overflow2(x,y); ++ if( x * y == 0 ) ++ return NULL; ++ ++ mem = malloc2(x,y); ++ if( mem == NULL ) ++ pm_error("out of memory allocating %d bytes", x * y); ++ return mem; ++} ++ + + static void + multi_adjust(cmap, row, palchange) +@@ -1355,6 +1373,9 @@ dcol_to_ppm(FILE * const ifP, + if( redmaxval != maxval || greenmaxval != maxval || bluemaxval != maxval ) + pm_message("scaling colors to %d bits", pm_maxvaltobits(maxval)); + ++ overflow_add(redmaxval, 1); ++ overflow_add(greenmaxval, 1); ++ overflow_add(bluemaxval, 1); + MALLOCARRAY_NOFAIL(redtable, redmaxval +1); + MALLOCARRAY_NOFAIL(greentable, greenmaxval +1); + MALLOCARRAY_NOFAIL(bluetable, bluemaxval +1); +@@ -1784,7 +1805,9 @@ PCHG_ConvertSmall(PCHG, cmap, mask, datasize) + ChangeCount32 = *data++; + datasize -= 2; + ++ overflow_add(ChangeCount16, ChangeCount32); + changes = ChangeCount16 + ChangeCount32; ++ overflow_add(changes, 1); + for( i = 0; i < changes; i++ ) { + if( totalchanges >= PCHG->TotalChanges ) goto fail; + if( datasize < 2 ) goto fail; +@@ -2049,6 +2072,9 @@ read_pchg(FILE * const ifP, + cmap->mp_change[i] = NULL; + if( PCHG.StartLine < 0 ) { + int nch; ++ if(PCHG.MaxReg < PCHG.MinReg) ++ pm_error("assert: MinReg > MaxReg"); ++ overflow_add(PCHG.MaxReg-PCHG.MinReg, 2); + nch = PCHG.MaxReg - PCHG.MinReg +1; + MALLOCARRAY_NOFAIL(cmap->mp_init, nch + 1); + for( i = 0; i < nch; i++ ) +@@ -2125,6 +2151,7 @@ process_body( FILE * const ifP, + if (typeid == ID_ILBM) { + int isdeep; + ++ overflow_add(bmhdP->w, 15); + MALLOCARRAY_NOFAIL(ilbmrow, RowBytes(bmhdP->w)); + *viewportmodesP |= fakeviewport; /* -isham/-isehb */ + +diff --git a/converter/ppm/imgtoppm.c b/converter/ppm/imgtoppm.c +index 7078b88..eb8509e 100644 +--- a/converter/ppm/imgtoppm.c ++++ b/converter/ppm/imgtoppm.c +@@ -84,6 +84,7 @@ main(int argc, char ** argv) { + len = atoi((char*) buf ); + if ( fread( buf, len, 1, ifp ) != 1 ) + pm_error( "bad colormap buf" ); ++ overflow2(cmaplen, 3); + if ( cmaplen * 3 != len ) + { + pm_message( +@@ -105,6 +106,7 @@ main(int argc, char ** argv) { + pm_error( "bad pixel data header" ); + buf[8] = '\0'; + len = atoi((char*) buf ); ++ overflow2(cols, rows); + if ( len != cols * rows ) + pm_message( + "pixel data length (%d) does not match image size (%d)", +diff --git a/converter/ppm/pcxtoppm.c b/converter/ppm/pcxtoppm.c +index e252ba2..270ae3b 100644 +--- a/converter/ppm/pcxtoppm.c ++++ b/converter/ppm/pcxtoppm.c +@@ -409,6 +409,7 @@ pcx_planes_to_pixels(pixels, bitplanes, bytesperline, planes, bitsperpixel) + /* + * clear the pixel buffer + */ ++ overflow2(bytesperline, 8); + npixels = (bytesperline * 8) / bitsperpixel; + p = pixels; + while (--npixels >= 0) +@@ -470,6 +471,7 @@ pcx_16col_to_ppm(FILE * const ifP, + } + + /* BytesPerLine should be >= BitsPerPixel * cols / 8 */ ++ overflow2(BytesPerLine, 8); + rawcols = BytesPerLine * 8 / BitsPerPixel; + if (headerCols > rawcols) { + pm_message("warning - BytesPerLine = %d, " +diff --git a/converter/ppm/picttoppm.c b/converter/ppm/picttoppm.c +index d412038..a59bf77 100644 +--- a/converter/ppm/picttoppm.c ++++ b/converter/ppm/picttoppm.c +@@ -1,3 +1,4 @@ ++#error "Unfixable. Don't ship me" + /* + * picttoppm.c -- convert a MacIntosh PICT file to PPM format. + * +diff --git a/converter/ppm/pjtoppm.c b/converter/ppm/pjtoppm.c +index 7b694fb..62ce77e 100644 +--- a/converter/ppm/pjtoppm.c ++++ b/converter/ppm/pjtoppm.c +@@ -127,20 +127,22 @@ main(argc, argv) + case 'V': /* send plane */ + case 'W': /* send last plane */ + if (rows == -1 || r >= rows || image == NULL) { +- if (rows == -1 || r >= rows) ++ if (rows == -1 || r >= rows) { ++ overflow_add(rows, 100); + rows += 100; ++ } ++ + if (image == NULL) { +- MALLOCARRAY(image, rows * planes); +- MALLOCARRAY(imlen, rows * planes); ++ image = (unsigned char **) ++ malloc3(rows , planes , sizeof(unsigned char *)); ++ imlen = (int *) malloc3(rows , planes, sizeof(int)); + } + else { +- image = (unsigned char **) +- realloc(image, +- rows * planes * +- sizeof(unsigned char *)); +- imlen = (int *) +- realloc(imlen, rows * planes * sizeof(int)); +- } ++ overflow2(rows,planes); ++ image = (unsigned char **) ++ realloc2(image, rows * planes, ++ sizeof(unsigned char *)); ++ imlen = (int *) realloc2(imlen, rows * planes, sizeof(int)); } + } + if (image == NULL || imlen == NULL) + pm_error("out of memory"); +@@ -212,8 +214,10 @@ main(argc, argv) + for (i = 0, c = 0; c < imlen[p + r * planes]; c += 2) + for (cmd = image[p + r * planes][c], + val = image[p + r * planes][c+1]; +- cmd >= 0 && i < newcols; cmd--, i++) ++ cmd >= 0 && i < newcols; cmd--, i++) { + buf[i] = val; ++ overflow_add(i, 1); ++ } + cols = cols > i ? cols : i; + free(image[p + r * planes]); + /* +@@ -224,6 +228,7 @@ main(argc, argv) + image[p + r * planes] = (unsigned char *) realloc(buf, i); + } + } ++ overflow2(cols, 8); + cols *= 8; + } + +diff --git a/converter/ppm/ppmtoeyuv.c b/converter/ppm/ppmtoeyuv.c +index f5ce115..6f072be 100644 +--- a/converter/ppm/ppmtoeyuv.c ++++ b/converter/ppm/ppmtoeyuv.c +@@ -114,6 +114,7 @@ create_multiplication_tables(const pixval maxval) { + + int index; + ++ overflow_add(maxval, 1); + MALLOCARRAY_NOFAIL(mult299 , maxval+1); + MALLOCARRAY_NOFAIL(mult587 , maxval+1); + MALLOCARRAY_NOFAIL(mult114 , maxval+1); +diff --git a/converter/ppm/ppmtolj.c b/converter/ppm/ppmtolj.c +index 7ed814e..b4e7db1 100644 +--- a/converter/ppm/ppmtolj.c ++++ b/converter/ppm/ppmtolj.c +@@ -182,6 +182,7 @@ int main(int argc, char *argv[]) { + ppm_readppminit( ifp, &cols, &rows, &maxval, &format ); + pixelrow = ppm_allocrow( cols ); + ++ overflow2(cols, 6); + 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) +diff --git a/converter/ppm/ppmtomitsu.c b/converter/ppm/ppmtomitsu.c +index e59f09b..1d2be20 100644 +--- a/converter/ppm/ppmtomitsu.c ++++ b/converter/ppm/ppmtomitsu.c +@@ -685,6 +685,8 @@ main(int argc, char * argv[]) { + medias = MSize_User; + + if (dpi300) { ++ overflow2(medias.maxcols, 2); ++ overflow2(medias.maxrows, 2); + medias.maxcols *= 2; + medias.maxrows *= 2; + } +diff --git a/converter/ppm/ppmtopcx.c b/converter/ppm/ppmtopcx.c +index fa68edc..97dfb2b 100644 +--- a/converter/ppm/ppmtopcx.c ++++ b/converter/ppm/ppmtopcx.c +@@ -425,6 +425,8 @@ ppmTo16ColorPcx(pixel ** const pixels, + else Planes = 1; + } + } ++ overflow2(BitsPerPixel, cols); ++ overflow_add(BitsPerPixel * cols, 7); + BytesPerLine = ((cols * BitsPerPixel) + 7) / 8; + MALLOCARRAY_NOFAIL(indexRow, cols); + MALLOCARRAY_NOFAIL(planesrow, BytesPerLine); +diff --git a/converter/ppm/ppmtopict.c b/converter/ppm/ppmtopict.c +index 36464b6..c91ccf2 100644 +--- a/converter/ppm/ppmtopict.c ++++ b/converter/ppm/ppmtopict.c +@@ -450,6 +450,8 @@ main(int argc, const char ** argv) { + putShort(stdout, 0); /* mode */ + + /* Finally, write out the data. */ ++ overflow_add(cols/MAX_COUNT, 1); ++ overflow_add(cols, cols/MAX_COUNT+1); + outBuf = malloc((unsigned)(cols+cols/MAX_COUNT+1)); + for (row = 0, oc = 0; row < rows; ++row) { + unsigned int rowSize; +diff --git a/converter/ppm/ppmtopj.c b/converter/ppm/ppmtopj.c +index d116773..fc84cac 100644 +--- a/converter/ppm/ppmtopj.c ++++ b/converter/ppm/ppmtopj.c +@@ -179,6 +179,7 @@ char *argv[]; + pixels = ppm_readppm( ifp, &cols, &rows, &maxval ); + + pm_close( ifp ); ++ overflow2(cols,2); + obuf = (unsigned char *) pm_allocrow(cols, sizeof(unsigned char)); + cbuf = (unsigned char *) pm_allocrow(cols * 2, sizeof(unsigned char)); + +diff --git a/converter/ppm/ppmtopjxl.c b/converter/ppm/ppmtopjxl.c +index 90bcef0..72d0027 100644 +--- a/converter/ppm/ppmtopjxl.c ++++ b/converter/ppm/ppmtopjxl.c +@@ -267,6 +267,9 @@ main(int argc, const char * argv[]) { + if (maxval > PCL_MAXVAL) + pm_error("color range too large; reduce with ppmcscale"); + ++ if (cols < 0 || rows < 0) ++ pm_error("negative size is not possible"); ++ + /* Figure out the colormap. */ + pm_message("Computing colormap..."); + chv = ppm_computecolorhist(pixels, cols, rows, MAXCOLORS, &colors); +@@ -286,6 +289,8 @@ main(int argc, const char * argv[]) { + case 0: /* direct mode (no palette) */ + bpp = bitsperpixel(maxval); /* bits per pixel */ + bpg = bpp; bpb = bpp; ++ overflow2(bpp, 3); ++ overflow_add(bpp*3, 7); + bpp = (bpp*3+7)>>3; /* bytes per pixel now */ + bpr = (bpp<<3)-bpg-bpb; + bpp *= cols; /* bytes per row now */ +@@ -295,9 +300,13 @@ main(int argc, const char * argv[]) { + case 3: case 7: pclindex++; + default: + bpp = 8/pclindex; ++ overflow_add(cols, bpp); ++ if(bpp == 0) ++ pm_error("assert: no bpp"); + bpp = (cols+bpp-1)/bpp; /* bytes per row */ + } + } ++ overflow2(bpp,2); + inrow = (char *)malloc((unsigned)bpp); + outrow = (char *)malloc((unsigned)bpp*2); + runcnt = (signed char *)malloc((unsigned)bpp); +diff --git a/converter/ppm/ppmtowinicon.c b/converter/ppm/ppmtowinicon.c +index c673798..af2b445 100644 +--- a/converter/ppm/ppmtowinicon.c ++++ b/converter/ppm/ppmtowinicon.c +@@ -12,6 +12,7 @@ + + #include + #include ++#include + + #include "pm_c_util.h" + #include "winico.h" +@@ -214,6 +215,7 @@ createAndBitmap (gray ** const ba, int const cols, int const rows, + MALLOCARRAY_NOFAIL(rowData, rows); + icBitmap->xBytes = xBytes; + icBitmap->data = rowData; ++ overflow2(xBytes, rows); + icBitmap->size = xBytes * rows; + for (y=0;yxBytes = xBytes; + icBitmap->data = rowData; ++ overflow2(xBytes, rows); + icBitmap->size = xBytes * rows; + + for (y=0;yxBytes = xBytes; + icBitmap->data = rowData; ++ overflow2(xBytes, rows); + icBitmap->size = xBytes * rows; + + for (y=0;ybitcount = bpp; + entry->ih = createInfoHeader(entry, xorBitmap, andBitmap); + entry->colors = palette->colors; +- entry->size_in_bytes = ++ overflow2(4, entry->color_count); ++ overflow_add(xorBitmap->size, andBitmap->size); ++ overflow_add(xorBitmap->size + andBitmap->size, 40); ++ overflow_add(xorBitmap->size + andBitmap->size + 40, 4 * entry->color_count); ++ entry->size_in_bytes = + xorBitmap->size + andBitmap->size + 40 + (4 * entry->color_count); + if (verbose) + pm_message("entry->size_in_bytes = %d + %d + %d = %d", +diff --git a/converter/ppm/ppmtoxpm.c b/converter/ppm/ppmtoxpm.c +index 0e31692..1b3923f 100644 +--- a/converter/ppm/ppmtoxpm.c ++++ b/converter/ppm/ppmtoxpm.c +@@ -198,6 +198,7 @@ genNumstr(unsigned int const input, int const digits) { + unsigned int i; + + /* Allocate memory for printed number. Abort if error. */ ++ overflow_add(digits, 1); + if (!(str = (char *) malloc(digits + 1))) + pm_error("out of memory"); + +@@ -315,6 +316,7 @@ genCmap(colorhist_vector const chv, + unsigned int charsPerPixel; + unsigned int xpmMaxval; + ++ if (includeTransparent) overflow_add(ncolors, 1); + MALLOCARRAY(cmap, cmapSize); + if (cmapP == NULL) + pm_error("Out of memory allocating %u bytes for a color map.", +diff --git a/converter/ppm/qrttoppm.c b/converter/ppm/qrttoppm.c +index 935463e..653084c 100644 +--- a/converter/ppm/qrttoppm.c ++++ b/converter/ppm/qrttoppm.c +@@ -46,7 +46,7 @@ main( argc, argv ) + + ppm_writeppminit( stdout, cols, rows, maxval, 0 ); + pixelrow = ppm_allocrow( cols ); +- buf = (unsigned char *) malloc( 3 * cols ); ++ buf = (unsigned char *) malloc2( 3 , cols ); + if ( buf == (unsigned char *) 0 ) + pm_error( "out of memory" ); + +diff --git a/converter/ppm/sldtoppm.c b/converter/ppm/sldtoppm.c +index 5ce92c2..2a482be 100644 +--- a/converter/ppm/sldtoppm.c ++++ b/converter/ppm/sldtoppm.c +@@ -154,127 +154,85 @@ vscale(int * const px, + + + +-static void +-upcase(const char * const sname, +- char * const uname) { +- +- unsigned int i; +- const char * ip; +- +- for (i = 0, ip = sname; i < 31; ++i) { +- char const ch = *ip++; +- +- if (ch != EOS) +- uname[i] = islower(ch) ? toupper(ch) : ch; +- } +- uname[i] = EOS; +-} +- +- +- +-static void +-skipBytes(FILE * const fileP, +- unsigned int const count) { +- +- unsigned int i; +- +- for (i = 0; i < count; ++i) +- getc(fileP); +-} +- +- +- +-static void +-scanDirectory(FILE * const slFileP, +- long const dirPos, +- bool const dirOnly, +- const char * const uname, +- bool * const foundP) { +-/*---------------------------------------------------------------------------- +- Scan the directory at the current position in *slFileP, either listing +- the directory ('dirOnly' true) or searching for a slide named +- 'uname' ('dirOnly' false). +- +- 'dirPos' is the offset in the file of the directory, i.e. the current +- position of *slFileP. +- +- In the latter case, return as *foundP whether the slide name is there. +------------------------------------------------------------------------------*/ +- bool found; +- bool eof; +- long pos; +- unsigned char libent[36]; +- +- for (found = false, eof = false, pos = dirPos; !found && !eof; ) { +- size_t readCt; +- readCt = fread(libent, 36, 1, slFileP); +- if (readCt != 1) +- eof = true; +- else { +- /* The directory entry is 32 bytes of NUL-terminated slide name +- followed by 4 bytes of offset of the next directory entry. +- */ +- const char * const slideName = (const char *)(&libent[0]); +- if (pm_strnlen(slideName, 32) == 32) +- pm_error("Invalid input: slide name field is not " +- "nul-terminated"); +- else { +- if (strlen(slideName) == 0) +- eof = true; +- else { +- pos += 36; +- if (dirOnly) { +- pm_message(" %s", slideName); +- } else if (streq(slideName, uname)) { +- long const dpos = +- (((((libent[35] << 8) | libent[34]) << 8) | +- libent[33]) << 8) | libent[32]; +- +- if ((slFileP == stdin) || +- (fseek(slFileP, dpos, 0) == -1)) { +- +- skipBytes(slFileP, dpos - pos); +- } +- found = true; +- } +- } +- } +- } +- } +- *foundP = found; +-} +- + /* SLIDEFIND -- Find a slide in a library or, if DIRONLY is + nonzero, print a directory listing of the library. + If UCASEN is nonzero, the requested slide name is + converted to upper case. */ + + static void +-slidefind(const char * const slideName, +- bool const dirOnly, ++slidefind(const char * const sname, ++ bool const dironly, + bool const ucasen) { + +- char uname[32]; /* upper case translation of 'slideName' */ +- char header[32]; /* (supposed) header read from file */ ++ char uname[32]; ++ unsigned char libent[36]; ++ long pos; + bool found; ++ bool eof; + +- if (dirOnly) ++ if (dironly) + pm_message("Slides in library:"); + else { +- upcase(slideName, uname); ++ unsigned int i; ++ const char * ip; ++ ++ ip = sname; /* initial value */ ++ ++ for (i = 0; i < 31; ++i) { ++ char const ch = *ip++; ++ if (ch == EOS) ++ break; ++ ++ { ++ char const upperCh = ++ ucasen && islower(ch) ? toupper(ch) : ch; ++ ++ uname[i] = upperCh; ++ } ++ } ++ uname[i] = EOS; + } + + /* Read slide library header and verify. */ +- +- if ((fread(header, 32, 1, slfile) != 1) || +- (!STRSEQ(header, "AutoCAD Slide Library 1.0\r\n\32"))) { ++ ++ if ((fread(libent, 32, 1, slfile) != 1) || ++ (!streq((char *)libent, "AutoCAD Slide Library 1.0\015\012\32"))) { + pm_error("not an AutoCAD slide library file."); + } ++ pos = 32; ++ ++ /* Search for a slide with the requested name or list the directory */ ++ ++ for (found = false, eof = false; !found && !eof; ) { ++ size_t readCt; ++ readCt = fread(libent, 36, 1, slfile); ++ if (readCt != 1) ++ eof = true; ++ else if (strlen((char *)libent) == 0) ++ eof = true; ++ } ++ if (!eof) { ++ pos += 36; ++ if (dironly) { ++ pm_message(" %s", libent); ++ } else if (streq((char *)libent, uname)) { ++ long dpos; ++ ++ dpos = (((((libent[35] << 8) | libent[34]) << 8) | ++ libent[33]) << 8) | libent[32]; ++ ++ if ((slfile == stdin) || (fseek(slfile, dpos, 0) == -1)) { ++ dpos -= pos; ++ ++ while (dpos-- > 0) ++ getc(slfile); ++ } ++ found = true; ++ } ++ } + +- scanDirectory(slfile, 32, dirOnly, ucasen ? uname : slideName, &found); +- +- if (!found && !dirOnly) +- pm_error("slide '%s' not in library.", slideName); ++ if (!found && !dironly) ++ pm_error("slide '%s' not in library.", sname); + } + + +@@ -392,7 +350,7 @@ slider(slvecfn slvec, + + /* Verify that slide format is compatible with this program. */ + +- if (!STRSEQ(slfrof.slh, slhi.slh)) ++ if (streq(slfrof.slh, slhi.slh)) + pm_error("this is not an AutoCAD slide file."); + + /* Verify that the number format and file level in the header are +@@ -506,6 +464,8 @@ slider(slvecfn slvec, + + /* Allocate image buffer and clear it to black. */ + ++ overflow_add(ixdots, 1); ++ overflow_add(iydots, 1); + pixels = ppm_allocarray(pixcols = ixdots + 1, pixrows = iydots + 1); + PPM_ASSIGN(rgbcolor, 0, 0, 0); + ppmd_filledrectangle(pixels, pixcols, pixrows, pixmaxval, 0, 0, +diff --git a/converter/ppm/ximtoppm.c b/converter/ppm/ximtoppm.c +index 75faac6..5758739 100644 +--- a/converter/ppm/ximtoppm.c ++++ b/converter/ppm/ximtoppm.c +@@ -118,6 +118,7 @@ ReadXimHeader(FILE * const in_fp, + header->bits_channel = atoi(a_head.bits_per_channel); + header->alpha_flag = atoi(a_head.alpha_channel); + if (strlen(a_head.author)) { ++ overflow_add(strlen(a_head.author),1); + if (!(header->author = calloc((unsigned int)strlen(a_head.author)+1, + 1))) { + pm_message("ReadXimHeader: can't calloc author string" ); +@@ -127,6 +128,7 @@ ReadXimHeader(FILE * const in_fp, + strncpy(header->author, a_head.author, strlen(a_head.author)); + } + if (strlen(a_head.date)) { ++ overflow_add(strlen(a_head.date),1); + if (!(header->date =calloc((unsigned int)strlen(a_head.date)+1,1))){ + pm_message("ReadXimHeader: can't calloc date string" ); + return(0); +@@ -135,6 +137,7 @@ ReadXimHeader(FILE * const in_fp, + strncpy(header->date, a_head.date, strlen(a_head.date)); + } + if (strlen(a_head.program)) { ++ overflow_add(strlen(a_head.program),1); + if (!(header->program = calloc( + (unsigned int)strlen(a_head.program) + 1, 1))) { + pm_message("ReadXimHeader: can't calloc program string" ); +@@ -161,6 +164,7 @@ ReadXimHeader(FILE * const in_fp, + if (header->nchannels == 3 && header->bits_channel == 8) + header->ncolors = 0; + else if (header->nchannels == 1 && header->bits_channel == 8) { ++ overflow2(header->ncolors, sizeof(Color)); + header->colors = (Color *)calloc((unsigned int)header->ncolors, + sizeof(Color)); + if (header->colors == NULL) { +diff --git a/editor/pamcut.c b/editor/pamcut.c +index 7c41af3..72df687 100644 +--- a/editor/pamcut.c ++++ b/editor/pamcut.c +@@ -655,6 +655,8 @@ cutOneImage(FILE * const ifP, + + outpam = inpam; /* Initial value -- most fields should be same */ + outpam.file = ofP; ++ overflow_add(rightcol, 1); ++ overflow_add(bottomrow, 1); + outpam.width = rightcol - leftcol + 1; + outpam.height = bottomrow - toprow + 1; + +diff --git a/editor/pnmgamma.c b/editor/pnmgamma.c +index b357b0d..ec612d3 100644 +--- a/editor/pnmgamma.c ++++ b/editor/pnmgamma.c +@@ -596,6 +596,7 @@ createGammaTables(enum transferFunction const transferFunction, + xelval ** const btableP) { + + /* Allocate space for the tables. */ ++ overflow_add(maxval, 1); + MALLOCARRAY(*rtableP, maxval+1); + MALLOCARRAY(*gtableP, maxval+1); + MALLOCARRAY(*btableP, maxval+1); +diff --git a/editor/pnmhisteq.c b/editor/pnmhisteq.c +index 8af4201..0c8d6e5 100644 +--- a/editor/pnmhisteq.c ++++ b/editor/pnmhisteq.c +@@ -107,6 +107,7 @@ computeLuminosityHistogram(xel * const * const xels, + unsigned int pixelCount; + unsigned int * lumahist; + ++ overflow_add(maxval, 1); + MALLOCARRAY(lumahist, maxval + 1); + if (lumahist == NULL) + pm_error("Out of storage allocating array for %u histogram elements", +diff --git a/editor/pnmindex.csh b/editor/pnmindex.csh +index c6f1e84..c513a84 100755 +--- a/editor/pnmindex.csh ++++ b/editor/pnmindex.csh +@@ -1,5 +1,7 @@ + #!/bin/csh -f + # ++echo "Unsafe code, needs debugging, do not ship" ++exit 1 + # pnmindex - build a visual index of a bunch of anymaps + # + # Copyright (C) 1991 by Jef Poskanzer. +diff --git a/editor/pnmpad.c b/editor/pnmpad.c +index 9c7a77e..1aa578c 100644 +--- a/editor/pnmpad.c ++++ b/editor/pnmpad.c +@@ -634,6 +634,8 @@ main(int argc, const char ** argv) { + + computePadSizes(cmdline, cols, rows, &lpad, &rpad, &tpad, &bpad); + ++ overflow_add(cols, lpad); ++ overflow_add(cols + lpad, rpad); + newcols = cols + lpad + rpad; + + if (PNM_FORMAT_TYPE(format) == PBM_TYPE) +diff --git a/editor/pnmremap.c b/editor/pnmremap.c +index ed758aa..73968be 100644 +--- a/editor/pnmremap.c ++++ b/editor/pnmremap.c +@@ -468,6 +468,7 @@ fserr_init(struct pam * const pamP, + + unsigned int const fserrSize = pamP->width + 2; + ++ overflow_add(pamP->width, 2); + fserrP->width = pamP->width; + + MALLOCARRAY(fserrP->thiserr, pamP->depth); +@@ -505,6 +506,7 @@ floydInitRow(struct pam * const pamP, struct Fserr * const fserrP) { + + int col; + ++ overflow_add(pamP->width, 2); + for (col = 0; col < pamP->width + 2; ++col) { + unsigned int plane; + for (plane = 0; plane < pamP->depth; ++plane) +diff --git a/editor/pnmscalefixed.c b/editor/pnmscalefixed.c +index 884ca31..747cd8f 100644 +--- a/editor/pnmscalefixed.c ++++ b/editor/pnmscalefixed.c +@@ -214,6 +214,7 @@ compute_output_dimensions(const struct cmdline_info cmdline, + const int rows, const int cols, + int * newrowsP, int * newcolsP) { + ++ overflow2(rows, cols); + if (cmdline.pixels) { + if (rows * cols <= cmdline.pixels) { + *newrowsP = rows; +@@ -265,6 +266,8 @@ compute_output_dimensions(const struct cmdline_info cmdline, + + if (*newcolsP < 1) *newcolsP = 1; + if (*newrowsP < 1) *newrowsP = 1; ++ ++ overflow2(*newcolsP, *newrowsP); + } + + +@@ -446,6 +449,9 @@ main(int argc, char **argv ) { + unfilled. We can address that by stretching, whereas the other + case would require throwing away some of the input. + */ ++ ++ overflow2(newcols, SCALE); ++ overflow2(newrows, SCALE); + sxscale = SCALE * newcols / cols; + syscale = SCALE * newrows / rows; + +diff --git a/editor/ppmdither.c b/editor/ppmdither.c +index ec1b977..e701e09 100644 +--- a/editor/ppmdither.c ++++ b/editor/ppmdither.c +@@ -356,6 +356,11 @@ dithMatrix(unsigned int const dithPower) { + (dithDim * sizeof(*dithMat)) + /* pointers */ + (dithDim * dithDim * sizeof(**dithMat)); /* data */ + ++ ++ overflow2(dithDim, sizeof(*dithMat)); ++ overflow3(dithDim, dithDim, sizeof(**dithMat)); ++ overflow_add(dithDim * sizeof(*dithMat), dithDim * dithDim * sizeof(**dithMat)); ++ + dithMat = malloc(dithMatSize); + + if (dithMat == NULL) +diff --git a/editor/specialty/pamoil.c b/editor/specialty/pamoil.c +index 6cb8d3a..6f4bde9 100644 +--- a/editor/specialty/pamoil.c ++++ b/editor/specialty/pamoil.c +@@ -112,6 +112,7 @@ main(int argc, char *argv[] ) { + tuples = pnm_readpam(ifp, &inpam, PAM_STRUCT_SIZE(tuple_type)); + pm_close(ifp); + ++ overflow_add(inpam.maxval, 1); + MALLOCARRAY(hist, inpam.maxval + 1); + if (hist == NULL) + pm_error("Unable to allocate memory for histogram."); +diff --git a/lib/libpam.c b/lib/libpam.c +index fa1be8f..e5cef1a 100644 +--- a/lib/libpam.c ++++ b/lib/libpam.c +@@ -225,7 +225,8 @@ allocPamRow(const struct pam * const pamP) { + unsigned int const bytesPerTuple = allocationDepth(pamP) * sizeof(sample); + tuple * tuplerow; + +- tuplerow = malloc(pamP->width * (sizeof(tuple *) + bytesPerTuple)); ++ overflow_add(sizeof(tuple *), bytesPerTuple); ++ tuplerow = malloc2(pamP->width, (sizeof(tuple *) + bytesPerTuple)); + + if (tuplerow != NULL) { + /* Now we initialize the pointers to the individual tuples +diff --git a/lib/libpammap.c b/lib/libpammap.c +index 2222491..ba27a4c 100644 +--- a/lib/libpammap.c ++++ b/lib/libpammap.c +@@ -108,7 +108,9 @@ allocTupleIntListItem(struct pam * const pamP) { + */ + struct tupleint_list_item * retval; + +- unsigned int const size = ++ overflow2(pamP->depth, sizeof(sample)); ++ overflow_add(sizeof(*retval)-sizeof(retval->tupleint.tuple), pamP->depth*sizeof(sample)); ++ unsigned int const size = + sizeof(*retval) - sizeof(retval->tupleint.tuple) + + pamP->depth * sizeof(sample); + +diff --git a/lib/libpm.c b/lib/libpm.c +index f9aa1ae..36c49c7 100644 +--- a/lib/libpm.c ++++ b/lib/libpm.c +@@ -888,5 +888,53 @@ pm_parse_height(const char * const arg) { + return height; + } + ++/* ++ * Maths wrapping ++ */ + ++void __overflow2(int a, int b) ++{ ++ if(a < 0 || b < 0) ++ pm_error("object too large"); ++ if(b == 0) ++ return; ++ if(a > INT_MAX / b) ++ pm_error("object too large"); ++} ++ ++void overflow3(int a, int b, int c) ++{ ++ overflow2(a,b); ++ overflow2(a*b, c); ++} ++ ++void overflow_add(int a, int b) ++{ ++ if( a > INT_MAX - b) ++ pm_error("object too large"); ++} ++ ++void *malloc2(int a, int b) ++{ ++ overflow2(a, b); ++ if(a*b == 0) ++ pm_error("Zero byte allocation"); ++ return malloc(a*b); ++} ++ ++void *malloc3(int a, int b, int c) ++{ ++ overflow3(a, b, c); ++ if(a*b*c == 0) ++ pm_error("Zero byte allocation"); ++ return malloc(a*b*c); ++} ++ ++void *realloc2(void * a, int b, int c) ++{ ++ overflow2(b, c); ++ if(b*c == 0) ++ pm_error("Zero byte allocation"); ++ return realloc(a, b*c); ++} + +diff --git a/lib/pm.h b/lib/pm.h +index 47cbfe8..5005df2 100644 +--- a/lib/pm.h ++++ b/lib/pm.h +@@ -434,5 +434,12 @@ pm_parse_height(const char * const arg); + } + #endif + ++void *malloc2(int, int); ++void *malloc3(int, int, int); ++#define overflow2(a,b) __overflow2(a,b) ++void __overflow2(int, int); ++void overflow3(int, int, int); ++void overflow_add(int, int); ++ + + #endif +diff --git a/other/pnmcolormap.c b/other/pnmcolormap.c +index 57db432..7195295 100644 +--- a/other/pnmcolormap.c ++++ b/other/pnmcolormap.c +@@ -840,6 +840,7 @@ colormapToSquare(struct pam * const pamP, + pamP->width = intsqrt; + else + pamP->width = intsqrt + 1; ++ overflow_add(intsqrt, 1); + } + { + unsigned int const intQuotient = colormap.size / pamP->width; +diff --git a/urt/Runput.c b/urt/Runput.c +index 3bc562a..645a376 100644 +--- a/urt/Runput.c ++++ b/urt/Runput.c +@@ -202,10 +202,11 @@ RunSetup(rle_hdr * the_hdr) + if ( the_hdr->background != 0 ) + { + register int i; +- register rle_pixel *background = +- (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); +- register int *bg_color; +- /* ++ 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 +225,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, +diff --git a/urt/rle.h b/urt/rle.h +index 0766d22..c80a5fa 100644 +--- a/urt/rle.h ++++ b/urt/rle.h +@@ -160,6 +160,17 @@ rle_hdr /* End of typedef. */ + */ + extern rle_hdr rle_dflt_hdr; + ++/* ++ * Provided by pm library ++ */ ++ ++extern void overflow_add(int, int); ++#define overflow2(a,b) __overflow2(a,b) ++extern void __overflow2(int, int); ++extern void overflow3(int, int, int); ++extern void *malloc2(int, int); ++extern void *malloc3(int, int, int); ++extern void *realloc2(void *, int, int); + + /* Declare RLE library routines. */ + +diff --git a/urt/rle_addhist.c b/urt/rle_addhist.c +index b165175..e09ed94 100644 +--- a/urt/rle_addhist.c ++++ b/urt/rle_addhist.c +@@ -70,13 +70,18 @@ rle_addhist(char * argv[], + return; + + length = 0; +- for (i = 0; argv[i]; ++i) ++ for (i = 0; argv[i]; ++i) { ++ overflow_add(length, strlen(argv[i])); ++ overflow_add(length+1, strlen(argv[i])); + length += strlen(argv[i]) +1; /* length of each arg plus space. */ ++ } + + time(&temp); + timedate = ctime(&temp); + length += strlen(timedate); /* length of date and time in ASCII. */ +- ++ overflow_add(strlen(padding), 4); ++ overflow_add(strlen(histoire), strlen(padding) + 4); ++ overflow_add(length, strlen(histoire) + strlen(padding) + 4); + length += strlen(padding) + 3 + strlen(histoire) + 1; + /* length of padding, "on " and length of history name plus "="*/ + if (in_hdr) /* if we are interested in the old comments... */ +@@ -84,8 +89,10 @@ rle_addhist(char * argv[], + else + old = NULL; + +- if (old && *old) ++ if (old && *old) { ++ overflow_add(length, strlen(old)); + length += strlen(old); /* add length if there. */ ++ } + + ++length; /*Cater for the null. */ + +diff --git a/urt/rle_getrow.c b/urt/rle_getrow.c +index 679811c..cc1f5cb 100644 +--- a/urt/rle_getrow.c ++++ b/urt/rle_getrow.c +@@ -160,6 +160,7 @@ rle_get_setup(rle_hdr * const the_hdr) { + char * cp; + + VAXSHORT(comlen, infile); /* get comment length */ ++ overflow_add(comlen, 1); + evenlen = (comlen + 1) & ~1; /* make it even */ + if (evenlen) { + MALLOCARRAY(comment_buf, evenlen); +diff --git a/urt/rle_hdr.c b/urt/rle_hdr.c +index 1611324..7c9c010 100644 +--- a/urt/rle_hdr.c ++++ b/urt/rle_hdr.c +@@ -80,7 +80,10 @@ int img_num; + /* Fill in with copies of the strings. */ + if ( the_hdr->cmd != pgmname ) + { +- char *tmp = (char *)malloc( strlen( pgmname ) + 1 ); ++ char *tmp; ++ ++ overflow_add(strlen(pgmname), 1); ++ tmp = malloc( strlen(pgmname) + 1 ); + RLE_CHECK_ALLOC( pgmname, tmp, 0 ); + strcpy( tmp, pgmname ); + the_hdr->cmd = tmp; +@@ -88,8 +91,10 @@ int img_num; + + if ( the_hdr->file_name != fname ) + { +- char *tmp = (char *)malloc( strlen( fname ) + 1 ); +- RLE_CHECK_ALLOC( pgmname, tmp, 0 ); ++ char *tmp; ++ overflow_add(strlen(fname), 1); ++ tmp = malloc( strlen( fname ) + 1 ); ++ RLE_CHECK_ALLOC( pgmname, tmp, 0 ); + strcpy( tmp, fname ); + the_hdr->file_name = tmp; + } +@@ -153,6 +158,7 @@ rle_hdr *from_hdr, *to_hdr; + if ( to_hdr->bg_color ) + { + int size = to_hdr->ncolors * sizeof(int); ++ overflow2(to_hdr->ncolors, sizeof(int)); + to_hdr->bg_color = (int *)malloc( size ); + RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->bg_color, "background color" ); + memcpy( to_hdr->bg_color, from_hdr->bg_color, size ); +@@ -161,7 +167,7 @@ rle_hdr *from_hdr, *to_hdr; + if ( to_hdr->cmap ) + { + int size = to_hdr->ncmap * (1 << to_hdr->cmaplen) * sizeof(rle_map); +- to_hdr->cmap = (rle_map *)malloc( size ); ++ to_hdr->cmap = (rle_map *)malloc3( to_hdr->ncmap, 1<cmaplen, sizeof(rle_map)); + RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->cmap, "color map" ); + memcpy( to_hdr->cmap, from_hdr->cmap, size ); + } +@@ -173,12 +179,17 @@ rle_hdr *from_hdr, *to_hdr; + { + int size = 0; + CONST_DECL char **cp; +- for ( cp=to_hdr->comments; *cp; cp++ ) ++ for ( cp=to_hdr->comments; *cp; cp++ ) ++ { ++ overflow_add(size, 1); + size++; /* Count the comments. */ ++ } + /* Check if there are really any comments. */ + if ( size ) + { ++ overflow_add(size, 1); + size++; /* Copy the NULL pointer, too. */ ++ overflow2(size, sizeof(char *)); + size *= sizeof(char *); + to_hdr->comments = (CONST_DECL char **)malloc( size ); + RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->comments, "comments" ); +diff --git a/urt/rle_open_f.c b/urt/rle_open_f.c +index ae8548b..c2ef37d 100644 +--- a/urt/rle_open_f.c ++++ b/urt/rle_open_f.c +@@ -163,65 +163,7 @@ dealWithSubprocess(const char * const file_name, + FILE ** const fpP, + bool * const noSubprocessP, + const char ** const errorP) { +- +-#ifdef NO_OPEN_PIPES + *noSubprocessP = TRUE; +-#else +- const char *cp; +- +- reapChildren(catchingChildrenP, pids); +- +- /* Real file, not stdin or stdout. If name ends in ".Z", +- * pipe from/to un/compress (depending on r/w mode). +- * +- * If it starts with "|", popen that command. +- */ +- +- cp = file_name + strlen(file_name) - 2; +- /* Pipe case. */ +- if (file_name[0] == '|') { +- pid_t thepid; /* PID from my_popen */ +- +- *noSubprocessP = FALSE; +- +- *fpP = my_popen(file_name + 1, mode, &thepid); +- if (*fpP == NULL) +- *errorP = "%s: can't invoke <<%s>> for %s: "; +- else { +- /* One more child to catch, eventually. */ +- if (*catchingChildrenP < MAX_CHILDREN) +- pids[(*catchingChildrenP)++] = thepid; +- } +- } else if (cp > file_name && *cp == '.' && *(cp + 1) == 'Z' ) { +- /* Compress case. */ +- pid_t thepid; /* PID from my_popen. */ +- const char * command; +- +- *noSubprocessP = FALSE; +- +- if (*mode == 'w') +- pm_asprintf(&command, "compress > %s", file_name); +- else if (*mode == 'a') +- pm_asprintf(&command, "compress >> %s", file_name); +- else +- pm_asprintf(&command, "compress -d < %s", file_name); +- +- *fpP = my_popen(command, mode, &thepid); +- +- if (*fpP == NULL) +- *errorP = "%s: can't invoke 'compress' program, " +- "trying to open %s for %s"; +- else { +- /* One more child to catch, eventually. */ +- if (*catchingChildrenP < MAX_CHILDREN) +- pids[(*catchingChildrenP)++] = thepid; +- } +- pm_strfree(command); +- } else { +- *noSubprocessP = TRUE; +- *errorP = NULL; +- } +-#endif + } + + +diff --git a/urt/rle_putcom.c b/urt/rle_putcom.c +index ab2eb20..ce83615 100644 +--- a/urt/rle_putcom.c ++++ b/urt/rle_putcom.c +@@ -98,12 +98,14 @@ rle_putcom(const char * const value, + const char * v; + const char ** old_comments; + int i; +- for (i = 2, cp = the_hdr->comments; *cp != NULL; ++i, ++cp) ++ for (i = 2, cp = the_hdr->comments; *cp != NULL; ++i, ++cp) { ++ overflow_add(i, 1); + if (match(value, *cp) != NULL) { + v = *cp; + *cp = value; + return v; + } ++ } + /* Not found */ + /* Can't realloc because somebody else might be pointing to this + * comments block. Of course, if this were true, then the +diff --git a/urt/scanargs.c b/urt/scanargs.c +index f3af334..5e114bb 100644 +--- a/urt/scanargs.c ++++ b/urt/scanargs.c +@@ -62,9 +62,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 ); + static int _do_scanargs( int argc, char **argv, CONST_DECL char *format, diff --git a/SOURCES/netpbm-security-scripts.patch b/SOURCES/netpbm-security-scripts.patch new file mode 100644 index 0000000..24675fb --- /dev/null +++ b/SOURCES/netpbm-security-scripts.patch @@ -0,0 +1,335 @@ +diff -urNp old/converter/other/anytopnm neew/converter/other/anytopnm +--- old/converter/other/anytopnm 2017-09-05 12:58:26.795741945 +0200 ++++ neew/converter/other/anytopnm 2017-09-05 13:03:12.985472566 +0200 +@@ -537,9 +537,8 @@ else + + fi + +-tempdir=$(mktemp -d "${TMPDIR:-/tmp}/anytopnm.XXXXXXXX") || ++tempdir=$(mktemp -d -t anytopnm.XXXXXXXX) || + ( echo "Could not create temporary file. Exiting." 1>&2; exit 1; ) +-trap 'rm -rf $tempdir' 0 + + # Take out all spaces + # Find the filename extension for last-ditch efforts later +@@ -565,9 +564,17 @@ if [ "$filetype" = "unknown" ]; then + echo "$progname: unknown file type. " \ + "'file' says mime type is '$mimeType', " 1>&2 + echo "type description is '$typeDescription'" 1>&2 ++ if [ -d "$tempdir" ] ; then ++ rm -rf "$tempdir" ++ fi ++ + exit 1 + fi + + convertIt $file $filetype + ++if [ -d "$tempdir" ] ; then ++ rm -rf "$tempdir" ++fi ++ + exit 0 +diff -urNp old/editor/pamstretch-gen neew/editor/pamstretch-gen +--- old/editor/pamstretch-gen 2017-09-05 12:58:26.763741946 +0200 ++++ neew/editor/pamstretch-gen 2017-09-05 13:03:12.985472566 +0200 +@@ -34,12 +34,10 @@ if [ "$1" = "" ]; then + exit 1 + fi + +-tempdir=$(mktemp -d "${TMPDIR:-/tmp}/netpbm.XXXXXXXX") || ++tempfile=$(mktemp /tmp/pnmig.XXXXXXXX) || + ( echo "Could not create temporary file. Exiting." 1>&2; exit 1; ) + trap 'rm -rf $tempdir' 0 1 3 15 + +-tempfile=$tempdir/pnmig +- + if ! cat $2 >$tempfile 2>/dev/null; then + echo 'pamstretch-gen: error reading file' 1>&2 + exit 1 +diff -urNp old/editor/ppmfade neew/editor/ppmfade +--- old/editor/ppmfade 2017-09-05 12:58:26.767741946 +0200 ++++ neew/editor/ppmfade 2017-09-05 12:59:14.556731156 +0200 +@@ -40,6 +40,7 @@ exec perl -w -x -S -- "$0" "$@" + # + ############################################################################## + use strict; ++use File::Temp "tempdir"; + + sub doVersionHack($) { + my ($argvR) = @_; +@@ -149,20 +149,26 @@ if ($first_file ne "undefined") { + + 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 +176,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 +191,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("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"); + } 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"); + } + } elsif ($mode eq $RELIEF) { + if ($i == 1) { +- 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"); + } 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"); + } 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"); + } + if ($i == 10) { +- 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"); + } + 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"); + } 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"); + } 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"); + } + 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"); + } + } 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"); + } + 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"); + } 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"); + } 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"); + } + 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"); + } + } 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"); + } + 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"); + } 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"); + } 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"); + } + 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); +diff -urNp old/editor/ppmshadow neew/editor/ppmshadow +--- old/editor/ppmshadow 2017-09-05 12:58:26.768741946 +0200 ++++ neew/editor/ppmshadow 2017-09-05 13:02:51.480507649 +0200 +@@ -171,11 +171,12 @@ my $tmpdir = $ENV{TMPDIR} || "/tmp"; + my $ourtmp; + + if ($keeptemp) { +- $ourtmp = "$tmpdir/ppmshadow$$"; +- mkdir($ourtmp, 0777) or +- die("Unable to create directory for temporary files '$ourtmp"); ++ $ourtmp = chomp($ourtmp = `mktemp -d -t PPMshadow.XXXXXX`); ++ if($? >> 8) { ++ die "Can't create directory for temporary files"; ++ } + } else { +- $ourtmp = File::Temp::tempdir("$tmpdir/ppmshadowXXXX", UNLINK=>1); ++ $ourtmp = File::Temp::tempdir("$tmpdir/PPMshadow.XXXXXX", UNLINK=>1); + } + + # Apply defaults for arguments not specified diff --git a/SOURCES/netpbm-time.patch b/SOURCES/netpbm-time.patch new file mode 100644 index 0000000..680bf88 --- /dev/null +++ b/SOURCES/netpbm-time.patch @@ -0,0 +1,21 @@ +diff -up netpbm-10.47.05/converter/other/fiasco/config.h.time netpbm-10.47.05/converter/other/fiasco/config.h +--- netpbm-10.47.05/converter/other/fiasco/config.h.time 2009-12-10 08:34:36.000000000 +0100 ++++ netpbm-10.47.05/converter/other/fiasco/config.h 2009-12-10 08:43:54.000000000 +0100 +@@ -19,7 +19,7 @@ + #define STDC_HEADERS 1 + + /* Define if you can safely include both and . */ +-#define TIME_WITH_SYS_TIME 1 ++/* #undef TIME_WITH_SYS_TIME */ + + /* Define if the X Window System is missing or not being used. */ + #define X_DISPLAY_MISSING 1 +@@ -75,7 +75,7 @@ + #define HAVE_STRING_H 1 + + /* Define if you have the header file. */ +-#define HAVE_SYS_TIME_H 1 ++/* #undef HAVE_SYS_TIME_H */ + + /* Define if you have the header file. */ + #define HAVE_UNISTD_H 1 diff --git a/SOURCES/netpbm-xwdfix.patch b/SOURCES/netpbm-xwdfix.patch new file mode 100644 index 0000000..88626c7 --- /dev/null +++ b/SOURCES/netpbm-xwdfix.patch @@ -0,0 +1,11 @@ +--- netpbm-10.35/converter/other/xwdtopnm.c.xwdfix 2006-09-18 13:24:50.000000000 +0200 ++++ netpbm-10.35/converter/other/xwdtopnm.c 2006-09-18 13:27:26.000000000 +0200 +@@ -945,7 +945,7 @@ getpix(pixelReader * const rdrP) { + unsigned long const bitsToTakeMask = lsbmask[nBitsToTake]; + /* E.g. if nbitsToTake is 4, this is 0x0000000F */ + +- unsigned long bitsToTake; ++ unsigned int bitsToTake; + /* The actual bits we take, in the 'nBitsToTake' low bits */ + + assert(nBitsToTake <= 32); diff --git a/SPECS/netpbm.spec b/SPECS/netpbm.spec new file mode 100644 index 0000000..be4dc98 --- /dev/null +++ b/SPECS/netpbm.spec @@ -0,0 +1,1280 @@ +Summary: A library for handling different graphics file formats +Name: netpbm +Version: 10.82.00 +Release: 6%{?dist} +# See copyright_summary for details +License: BSD and GPLv2 and IJG and MIT and Public Domain +URL: http://netpbm.sourceforge.net/ +# Source0 is prepared by +# svn checkout https://svn.code.sf.net/p/netpbm/code/advanced netpbm-%%{version} +# svn checkout https://svn.code.sf.net/p/netpbm/code/userguide netpbm-%%{version}/userguide +# svn checkout https://svn.code.sf.net/p/netpbm/code/trunk/test netpbm-%%{version}/test +# and removing the .svn directories ( find -name "\.svn" -type d -print0 | xargs -0 rm -rf ) +# and removing the ppmtompeg code, due to patents ( rm -rf netpbm-%%{version}/converter/ppm/ppmtompeg/ ) +Source0: netpbm-%{version}.tar.xz +Patch0: netpbm-security-scripts.patch +Patch1: netpbm-security-code.patch +Patch2: netpbm-ppmfadeusage.patch +Patch3: netpbm-noppmtompeg.patch +Patch4: netpbm-CVE-2017-2587.patch +Patch5: netpbm-time.patch +Patch6: netpbm-gcc4.patch +Patch7: netpbm-bmptopnm.patch +Patch8: netpbm-CAN-2005-2471.patch +Patch9: netpbm-xwdfix.patch +Patch10: netpbm-multilib.patch +Patch11: netpbm-glibc.patch +Patch12: netpbm-docfix.patch +Patch13: netpbm-fiasco-overflow.patch +Patch14: netpbm-cmuwtopbm.patch +Patch15: netpbm-pamtojpeg2k.patch +Patch16: netpbm-manfix.patch +Patch17: netpbm-manual-pages.patch +Patch18: netpbm-annocheck.patch +Patch19: netpbm-jasper.patch +Patch20: netpbm-covscan.patch + +BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, flex, jbigkit-devel +BuildRequires: libX11-devel, perl-generators, python3, jasper-devel, libxml2-devel +BuildRequires: ghostscript + +%description +The netpbm package contains a library of functions which support +programs for handling various graphics file formats, including .pbm +(portable bitmaps), .pgm (portable graymaps), .pnm (portable anymaps), +.ppm (portable pixmaps) and others. + +%package devel +Summary: Development tools for programs which will use the netpbm libraries +Requires: netpbm = %{version}-%{release} + +%description devel +The netpbm-devel package contains the header files and static libraries, +etc., for developing programs which can handle the various graphics file +formats supported by the netpbm libraries. + +Install netpbm-devel if you want to develop programs for handling the +graphics file formats supported by the netpbm libraries. You'll also need +to have the netpbm package installed. + +%package progs +Summary: Tools for manipulating graphics files in netpbm supported formats +Requires: ghostscript +Requires: netpbm = %{version}-%{release} + +%description progs +The netpbm-progs package contains a group of scripts for manipulating the +graphics files in formats which are supported by the netpbm libraries. For +example, netpbm-progs includes the rasttopnm script, which will convert a +Sun rasterfile into a portable anymap. Netpbm-progs contains many other +scripts for converting from one graphics file format to another. + +If you need to use these conversion scripts, you should install +netpbm-progs. You'll also need to install the netpbm package. + +%package doc +Summary: Documentation for tools manipulating graphics files in netpbm supported formats +Requires: netpbm-progs = %{version}-%{release} + +%description doc +The netpbm-doc package contains a documentation in HTML format for utilities +present in netpbm-progs package. + +If you need to look into the HTML documentation, you should install +netpbm-doc. You'll also need to install the netpbm-progs package. + +%prep +%autosetup -p1 +sed -i 's|^#!/usr/bin/python|#!%{__python3}|' buildtools/makeman +rm -rf converter/other/jpeg2000/libjasper/ +rm -rf converter/other/jbig/libjbig/ + +%build +./configure < pgmtopbm +chmod 0755 pgmtopbm +popd + +%ldconfig_scriptlets + +%check +pushd test +export LD_LIBRARY_PATH=%{buildroot}%{_libdir} +export PBM_TESTPREFIX=%{buildroot}%{_bindir} +export PBM_BINPREFIX=%{buildroot}%{_bindir} +./Execute-Tests && exit 0 +popd + +%files +%doc doc/copyright_summary doc/COPYRIGHT.PATENT doc/HISTORY README +%license doc/GPL_LICENSE.txt +%{_libdir}/lib*.so* + +%files devel +%dir %{_includedir}/netpbm +%{_includedir}/netpbm/*.h +%{_mandir}/man3/* + +%files progs +%{_bindir}/* +%{_mandir}/man1/* +%{_mandir}/man5/* +%{_datadir}/netpbm/ + +%files doc +%doc userguide/* + +%changelog +* Tue Dec 04 2018 Josef Ridky - 10.82.00-6 +- fix covscan issues (#1602629) + +* Mon Nov 26 2018 Josef Ridky - 10.82.00-5 +- Use system version of jasper and jbigkit library (#1651586) + +* Mon Sep 24 2018 Josef Ridky - 10.82.00-4 +- fix annocheck distro flag (#1624150) + +* Mon Aug 13 2018 Josef Ridky - 10.82.00-3 +- fix python3 invocation in patches (#1615314) + +* Mon Jun 04 2018 Josef Ridky - 10.82.00-2 +- backport missing patches from RHEL-7 (#1584724) + +* Tue Mar 27 2018 Josef Ridky - 10.82.00-1 +- New upstream release 10.82.00 (#1560330) + +* Mon Feb 26 2018 Josef Ridky - 10.81.00-4 +- spec clean up +- build against Python3 + +* Thu Feb 08 2018 Fedora Release Engineering - 10.81.00-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Jan 22 2018 Josef Ridky - 10.81.00-2 +- change ghostscript requirement + +* Wed Jan 03 2018 Josef Ridky - 10.81.00-1 +- New upstream release 10.81.00 (#1529904) +- update spec file + +* Thu Oct 19 2017 Josef Ridky - 10.80.00-2 +- Rebuilt for python package + +* Mon Oct 02 2017 Josef Ridky - 10.80.00-1 +- New upstream release 10.80.00 (#1496797) + +* Thu Aug 03 2017 Fedora Release Engineering - 10.79.00-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 10.79.00-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Jul 03 2017 Josef Ridky - 10.79.00-1 +- New upstream release 10.79.00 (#1466772) + +* Wed Mar 29 2017 Josef Ridky - 10.78.00-1 +- New upstream release 10.78.00 + +* Wed Feb 08 2017 Josef Ridky - 10.77.00-3 +- fix CVE-2017-2586, CVE-2017-2587 (#1419545) +- fix CVE-2017-5849 (#1419650) + +* Mon Jan 23 2017 Josef Ridky - 10.77.00-2 +- fix #1404757 - add copyright_summary to doc section + +* Mon Jan 23 2017 Josef Ridky - 10.77.00-1 +- New upstream release 10.77.00 (#1408611) + +* Mon Dec 5 2016 Josef Ridky - 10.76.00-2 +- set Provides: bundled for jasper and jbigkit library (#1395716) + +* Thu Nov 10 2016 Josef Ridky - 10.76.00-1 +- Update to the latest upstream release 10.76.00 (#1393713) + +* Thu Jul 28 2016 Josef Ridky - 10.75.99-1 +- Update to the latest upstream release 10.75.99 (#1361103) + +* Thu Feb 04 2016 Fedora Release Engineering - 10.71.02-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Aug 10 2015 Petr Hracek - 10.71.02-1 +- Update to the latest upstream release (#1252352) + +* Thu Aug 06 2015 Petr Hracek - 10.66.02-7 +- remove doc/copyright_summary (#1219743) + +* Wed Jun 17 2015 Fedora Release Engineering - 10.66.02-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Jan 20 2015 Petr Hracek - 10.66.02-5 +- Moving libnetpbm.so from netpbm-devel to netpbm (#1180811) + +* Tue Jan 20 2015 Petr Hracek - 10.66.02-4 +- Add missing pnmtops to netpbm-progs (#1171903) + +* Sun Aug 17 2014 Fedora Release Engineering - 10.66.02-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 10.66.02-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue May 13 2014 Petr Hracek - 10.66.02-1 +- Update new sources (#1063264) + +* Mon Apr 14 2014 Jaromir Capik - 10.61.02-9 +- Fixing format-security flaws (#1037217) + +* Wed Nov 13 2013 Petr Hracek - 10.61.02-8 +- pnmtops hangs in case of more then 10 files (#1029512) + +* Sat Aug 03 2013 Fedora Release Engineering - 10.61.02-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jul 17 2013 Petr Pisar - 10.61.02-6 +- Perl 5.18 rebuild + +* Mon Jun 17 2013 Petr Hracek - 10.61.02-5 +- Manual page corrections (#948531) + +* Wed Jun 05 2013 Petr Hracek - 10.61.02-4 +- pnmpsnr: compare the same images failed (#969479) + +* Tue May 28 2013 Petr Hracek - 10.61.02-3 +- pnmtops: Multi-page PAM files correction (#833546) + +* Mon May 27 2013 Petr Hracek 10.61.02-2 +- Man page corrections (#948531) + +* Wed Feb 20 2013 Jindrich Novy 10.61.02-1 +- update to 10.61.02 + +* Thu Feb 14 2013 Fedora Release Engineering - 10.61.01-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Jan 21 2013 Adam Tkac - 10.61.01-2 +- rebuild due to "jpeg8-ABI" feature drop + +* Thu Jan 03 2013 Jindrich Novy 10.61.01-1 +- update to 10.61.01 +- sync patches + +* Fri Dec 14 2012 Jindrich Novy 10.60.05-1 +- update to 10.60.05 +- fixes pngtopam and ppmpat + +* Wed Dec 05 2012 Jindrich Novy 10.60.04-1 +- update to 10.60.04 +- fixes pamtotiff, pnmmontage, pnmpsnr, pbmpscale, pgmhist, + pampick, pamtompfont +- fix dates in changelog + +* Tue Nov 27 2012 Jindrich Novy 10.60.03-2 +- add upstream test suite + +* Wed Nov 21 2012 Jindrich Novy 10.60.03-1 +- update to 10.60.3 +- fixes xbmptopbm, pamtojpeg2k + +* Mon Oct 08 2012 Jindrich Novy 10.60.01-1 +- update to 10.60.01 +- fixes pamgauss, sunicontopnm + +* Tue Oct 02 2012 Jindrich Novy 10.60.00-1 +- update to 10.60.00 +- speeds up xpmtoppm + +* Tue Sep 25 2012 Jindrich Novy 10.59.03-1 +- update to 10.59.03 +- fixes xpmtoppm + +* Fri Jul 20 2012 Jindrich Novy 10.59.02-1 +- update to 10.59.02 +- fixes getline() glibc function conflict + +* Fri Jul 20 2012 Fedora Release Engineering - 10.59.01-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jul 11 2012 Jindrich Novy 10.59.01-1 +- update to 10.59.01 + +* Fri Jun 22 2012 Jindrich Novy 10.58.03-1 +- update to 10.58.03 +- pnmtops is back + +* Wed Jun 13 2012 Jindrich Novy 10.58.01-3 +- fix ppmtopict buffer underflow +- fix memory corruption in pnmtopclxl + +* Sun May 06 2012 Jindrich Novy 10.58.01-2 +- rebuild against new libtiff + +* Mon Apr 09 2012 Jindrich Novy 10.58.01-1 +- update to 10.58.01 + +* Mon Mar 12 2012 Jindrich Novy 10.57.04-1 +- update to 10.57.04 +- fixes ppmquantall + +* Fri Mar 02 2012 Jindrich Novy 10.57.03-1 +- update to 10.57.03 + +* Mon Feb 13 2012 Jindrich Novy 10.57.02-1 +- update to 10.57.02 + +* Tue Jan 17 2012 Jindrich Novy 10.57.01-1 +- update to 10.57.01 + +* Fri Jan 13 2012 Fedora Release Engineering - 10.56.05-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Dec 12 2011 Jindrich Novy 10.56.05-1 +- update to 10.56.05 +- fixes pamscale + +* Fri Nov 25 2011 Jindrich Novy 10.56.04-1 +- update to 10.56.04 +- fixes pngtopam +- use more robust way to create library symlinks + +* Wed Nov 16 2011 Jindrich Novy 10.56.03-2 +- fix library symlink to point to the new soname + +* Fri Nov 11 2011 Jindrich Novy 10.56.03-1 +- update to 10.56.03 +- fixes compilation against new libpng + +* Tue Sep 27 2011 Jindrich Novy 10.47.31-1 +- update to 10.47.31 +- fixes bmptopnm + +* Wed Aug 24 2011 Jindrich Novy 10.47.30-1 +- update to 10.47.30 +- fixes opacity in pnmtopng +- fixes pnmquant perl compatibility + +* Tue Jul 26 2011 Jindrich Novy 10.47.29-1 +- update to 10.47.29 + +* Tue Jun 28 2011 Jindrich Novy 10.47.28-1 +- update to 10.47.28 + +* Mon Mar 28 2011 Jindrich Novy 10.47.27-1 +- update to 10.47.27 +- fixes error message in g3topbm + documentation fixes + +* Tue Feb 08 2011 Fedora Release Engineering - 10.47.26-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Feb 7 2011 Jindrich Novy 10.47.26-1 +- update to 10.47.26 +- drop upstreamed asciitopgm patch + +* Mon Jan 17 2011 Jindrich Novy 10.47.25-1 +- update to 10.47.25 +- fix asciitopgm (#670082), thanks to Jonathan Kamens + +* Sat Jan 1 2011 Jindrich Novy 10.47.24-1 +- update to 10.47.24 + +* Tue Dec 14 2010 Jindrich Novy 10.47.23-1 +- update to 10.47.23 + +* Tue Oct 19 2010 Jindrich Novy 10.47.21-2 +- fix HTML pages from which man pages are now generated correctly (#644248) + +* Mon Oct 18 2010 Jindrich Novy 10.47.21-1 +- update to 10.47.21 + +* Fri Oct 1 2010 Jindrich Novy 10.47.20-1 +- update to 10.47.20 + +* Mon Aug 30 2010 Jindrich Novy 10.47.19-1 +- update to 10.47.19 + +* Sat Aug 14 2010 Jindrich Novy 10.47.18-1 +- update to 10.47.18 + +* Mon Jul 12 2010 Jindrich Novy 10.47.17-1 +- update to 10.47.17 + +* Fri Jun 18 2010 Jindrich Novy 10.47.16-1 +- update to 10.47.16 +- fixes pbmtext + +* Mon Jun 7 2010 Jindrich Novy 10.47.15-1 +- update to 10.47.15 + +* Tue Jun 1 2010 Jindrich Novy 10.47.14-2 +- add -fno-strict-aliasing to CFLAGS + +* Fri May 21 2010 Jindrich Novy 10.47.14-1 +- update to 10.47.14 +- fixes memory leak in pamarith + +* Tue May 4 2010 Jindrich Novy 10.47.13-1 +- update to 10.47.13 +- fixes pnmtops + +* Mon May 3 2010 Jindrich Novy 10.47.12-3 +- fix cmuwtopbm so that magic bytes test actually works +- fix pamtojpeg2k (don't close stdout twice) +- fix documentation for pamperspective and pbmtoepson + +* Wed Apr 28 2010 Jindrich Novy 10.47.12-2 +- fix CVE-2007-2721 (#501451) +- add missing man pages + +* Tue Apr 27 2010 Tom "spot" Callaway 10.47.12-1 +- update to 10.47.12 +- remove ppmtompeg, due to legal issues + +* Thu Mar 18 2010 Jindrich Novy 10.47.10-3 +- package docs in separate netpbm-doc package (#492437) +- don't package patch backups in documentation +- netpbm-progs package requires ghostscript + +* Wed Mar 17 2010 Jindrich Novy 10.47.10-2 +- pgmtopbm should generate PBM, not PAM file +- forwardport pnmmontage from 10.35 to make it work +- fix pamstretch-gen + +* Wed Feb 24 2010 Jindrich Novy 10.47.10-1 +- update to 10.47.10 +- fixes crash in pnmhistmap + +* Wed Feb 17 2010 Jindrich Novy 10.47.09-3 +- remove obsolete pgmtopbm and pnmcomp, symlink them to the new + compatible variants +- fix ppmfade -h, --help options +- add missing man pages +- link against -lz (#564649) + +* Wed Jan 27 2010 Jindrich Novy 10.47.09-2 +- fix buffer overflow in pnmtofiasco + +* Mon Jan 25 2010 Jindrich Novy 10.47.09-1 +- update to 10.47.09, fixes occassional crash in pamtosvg +- fix documentation +- fix ppmfade exit status + +* Wed Jan 13 2010 Jindrich Novy 10.47.08-1 +- update to 10.47.08 + +* Wed Dec 30 2009 Jindrich Novy 10.47.07-1 +- update to 10.47.07 + +* Mon Dec 14 2009 Jindrich Novy 10.47.06-1 +- update to 10.47.06 - fixes the dumb pamtosvg mistake in 10.47.05 +- pnmmargin won't create leftovers in /tmp (#547888) + +* Thu Dec 10 2009 Jindrich Novy 10.47.05-1 +- update to 10.47.05 +- fixes pnmtofiasco, fiascotopnm, pamtosvg, pamtouil and ppmrainbow +- upstream fix to pamtosvg caused netpbm not to be rebuildable on + any arch because of missing semicolon, the fix is now fixed :-/ + +* Mon Dec 7 2009 Jindrich Novy 10.47.04-3 +- fix segfault in pnmsmooth (#545089) + +* Fri Nov 27 2009 Jindrich Novy 10.47.04-2 +- fix ppmpat segfault when using -camo option (#541568) + +* Wed Oct 21 2009 Jindrich Novy 10.47.04-1 +- update to 10.47.04 (it is now stable) (#529525) + +* Fri Oct 9 2009 Jindrich Novy 10.35.68-1 +- update to 10.35.68 + +* Fri Sep 4 2009 Jindrich Novy 10.35.67-1 +- update to 10.35.67 +- fix configuration + +* Wed Jul 29 2009 Jindrich Novy 10.35.66-1 +- update to 10.35.66 +- sync svgatopam patch + +* Sat Jul 25 2009 Fedora Release Engineering - 10.35.65-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Sat Jun 27 2009 Jindrich Novy 10.35.65-1 +- update to 10.35.65 + +* Sun May 17 2009 Jindrich Novy 10.35.64-1 +- update to 10.35.64 +- fixes pnmremap, giftopnm, ppmpat, ppmdraw + +* Tue Apr 28 2009 Jindrich Novy 10.35.63-1 +- update to 10.35.63 +- basically new release with some of our patches applied upstream + +* Tue Apr 14 2009 Jindrich Novy 10.35.62-1 +- update to 10.35.62 +- upstream fixes pamstereogram +- fix options in pamperspective, pbmtoepson, ppmpat, pamaddnoise + so that they match their man pages (#483011, #483070, #483243, #483245) +- avoid clashes with getline() from glibc + +* Tue Mar 31 2009 Jindrich Novy 10.35.61-2 +- remove two hunks from security patch breaking pbmclean and pbmlife (#493015) +- fix ppmdfont and svgtopnm, thanks to Jiri Moskovcak + +* Mon Mar 23 2009 Jindrich Novy 10.35.61-1 +- update to 10.35.61 +- upstream fixes array bound violation in pbmtog3 +- drop .pbmtog3segfault patch, we fixed this some time ago already + and it is in upstream now +- use saner exit status in ppmfade + +* Thu Feb 26 2009 Jindrich Novy 10.35.60-3 +- fix broken perl syntax in ppmfade +- fix exit status and error reporting in ppmrainbow + +* Wed Feb 25 2009 Fedora Release Engineering - 10.35.60-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Feb 16 2009 Jindrich Novy 10.35.60-1 +- update to 10.35.60 +- update .security patch, minor cleanup +- fixes xwdtopnm for at least some direct color 24/32 images +- fixes memory leak and out of memory crash in libpammap + +* Thu Jan 29 2009 Jindrich Novy 10.35.59-1 +- update to 10.35.59 +- fixes array bound violation in ilbmtoppm +- fixes garbage output when input in fitstopnm is little endian + floating point FITS + +* Wed Jan 28 2009 Jindrich Novy 10.35.58-4 +- fix segfault in ximtoppm (#482891), the utility lacked the + command line parsing initialization code + +* Thu Jan 22 2009 Jindrich Novy 10.35.58-3 +- fix cmuwmtopbm and other utilities by making endianess + functions work correctly on 64bit systems (#476863) + +* Wed Jan 21 2009 Jindrich Novy 10.35.58-2 +- fix pnmtofiasco to accept image from stdin (#476989, #227283) + +* Mon Jan 19 2009 Jindrich Novy 10.35.58-1 +- update to 10.35.38 +- fixes crashes in picttoppm, pbmtomrf, mrftopbm +- fixes bugs in leaftoppm, ilbmtoppm + +* Tue Dec 23 2008 Jindrich Novy 10.35.57-3 +- unbreak ppmshadow and ppmrainbow (#476989) +- pnmmontage won't crash because of uninitialized memory usage + +* Fri Dec 19 2008 Jindrich Novy 10.35.57-2 +- fix segfault in pamtosvg caused by not reverting "sentinel value" (#476989) + +* Mon Dec 15 2008 Jindrich Novy 10.35.57-1 +- update to 10.35.57 + +* Thu Nov 6 2008 Jindrich Novy 10.35.55-1 +- update to 10.35.55 + +* Mon Oct 27 2008 Jindrich Novy 10.35.54-1 +- update to 10.35.54 +- adds better randomization for ppmforge, pgmnoise, pgmcrater +- fixes array bounds violation in pnm_createBlackTuple() with PBM, PGM +- fixes crash in pnmtoddif with any PGM input + +* Tue Oct 14 2008 Jindrich Novy 10.35.53-1 +- update to 10.35.53 +- fixes pamditherbw (-value parameter other than .5 with -fs) + +* Sat Sep 27 2008 Jindrich Novy 10.35.52-1 +- update to 10.35.52 +- fixes crash of libppmd/ppmdraw when line is completely out of frame + +* Thu Sep 18 2008 Jindrich Novy 10.35.51-1 +- update to netpbm-10.35.51 +- make it actually compilable by removing duplicated function + in pamcomp.c + +* Wed Aug 27 2008 Jindrich Novy 10.35.49-2 +- link against system jasper instead of embedded one (#460300) + +* Thu Aug 14 2008 Jindrich Novy 10.35.49-1 +- update to 10.35.49 +- fixes crash in pamcut when cutting a region entirely to the + left or right of the input image, with -pad + +* Mon Aug 11 2008 Tom "spot" Callaway 10.35.48-2 +- fix license tag + +* Mon Aug 4 2008 Jindrich Novy 10.35.48-1 +- update to 10.35.48 +- fixes buffer overrun in pamperspective and pngtopnm output format +- update .security2 patch so that it applies with fuzz==0 + +* Tue Jun 24 2008 Jindrich Novy 10.35.46-1 +- update to 10.35.46 +- fixes pbmtext, pamtotga, pamtouil and pnmtopclxl + +* Mon Jun 9 2008 Jindrich Novy 10.35.45-1 +- update to 10.35.45 +- fixes anytopnm, pamtohtmltbl, xvminitoppm, pbmtogo, tgatoppm + +* Mon May 26 2008 Jindrich Novy 10.35.44-1 +- update to 10.35.44 +- fixes pamscale PBM input with -nomix, pamtilt crash + +* Mon May 12 2008 Jindrich Novy 10.35.43-1 +- update to 10.35.43 +- fixes pbmtext and documentation of pamthreshold + +* Mon Apr 14 2008 Jindrich Novy 10.35.42-1 +- update to 10.35.42 +- fixes pnmnorm, resolution of conflicting -wpercent and -wvalue + +* Mon Mar 31 2008 Jindrich Novy 10.35.41-1 +- update to 10.35.41 (fixes pnmnorm and gcc-4.3 build) + +* Fri Mar 14 2008 Jindrich Novy 10.35.40-2 +- package rgb.txt for pnmtopng (#313301) +- drop useless xorg-x11-server-utils BR + +* Sun Mar 9 2008 Jindrich Novy 10.35.40-1 +- update to 10.35.40 (fixes pgmdeshadow, pgmmedian, pgmbentley and pamtosvg) + +* Mon Feb 25 2008 Jindrich Novy 10.35.39-1 +- update to 10.35.39 (fixes crash in pamtosvg) + +* Thu Feb 14 2008 Jindrich Novy 10.35.38-1 +- update to 10.35.38 (fixes to pbmtext and ppmtoarbtxt) +- fix to let it built with gcc 4.3 + +* Thu Jan 17 2008 Jindrich Novy 10.35.37-1 +- update to 10.35.37 + +* Mon Dec 31 2007 Jindrich Novy 10.35.36-1 +- update to 10.35.36 + +* Thu Dec 13 2007 Jindrich Novy 10.35.35-1 +- update to 10.35.35 + +* Mon Nov 26 2007 Jindrich Novy 10.35.34-1 +- update to 10.35.34 +- sync security patch and fix typos + +* Wed Nov 14 2007 Jindrich Novy 10.35.33-1 +- update to 10.35.33 + +* Fri Nov 2 2007 Jindrich Novy 10.35.32-2 +- remove man pages that lacks corresponding binaries (#220739) + +* Thu Oct 18 2007 Jindrich Novy 10.35.32-1 +- remove .svn directories from tarball to reduce its size +- update fixes rhbz#337181 and likely others + +* Thu Oct 18 2007 MATSUURA Takanori 10.35.32-0 +- update to 10.35.32 from svn tree +- create man pages from userguide HTML files + +* Thu Oct 11 2007 Jindrich Novy 10.35-17 +- add xorg-x11-server-utils BR (#313301) + +* Thu Aug 23 2007 Jindrich Novy 10.35-16 +- rebuild for ppc32 +- fix open() calls so that netpbm builds with new glibc + +* Mon Aug 20 2007 Jindrich Novy 10.35-15 +- fix .ppmquantall patch (#207799) +- merge cmapsize with bmptopnm patch (#224554) + +* Mon Jul 16 2007 Jindrich Novy 10.35-14 +- /usr/share/netpbm is no more unowned (#248300) + +* Wed Jun 20 2007 Jindrich Novy 10.35-13 +- package map files needed by pnmtopalm (#244983) + +* Thu Mar 29 2007 Jindrich Novy 10.35-12 +- merge review fixes (#226191), thanks to Jason Tibbitts + +* Fri Feb 2 2007 Jindrich Novy 10.35-11 +- fix pbmtomacp buffer overflow (#226969) + +* Mon Jan 29 2007 Jindrich Novy 10.35-10 +- bmptopnm won't crash with "BMPlencolormap: internal error!" (#224554) + +* Thu Dec 28 2006 Jindrich Novy 10.35-9 +- pbmtog3 won't segfault on 64bit arches (#220739) + +* Tue Dec 19 2006 Jindrich Novy 10.35-8 +- remove bogus man pages (#220112, #220113) +- overflow2() no more conflicts with libgd.so (#216116) +- fix BuildRoot + +* Thu Oct 12 2006 Jindrich Novy 10.35-7 +- remove note about OSL 1 licensing from COPYRIGHT.PATENT file + +* Mon Oct 2 2006 Jesse Keating 10.35-6 +- rebuild for new libpng, again. + +* Mon Oct 2 2006 Jesse Keating 10.35-5 +- rebuild for new libpng + +* Mon Oct 2 2006 Jindrich Novy 10.35-4 +- rebuild (#208866) + +* Fri Sep 29 2006 Jindrich Novy 10.35-3 +- remove OSL 1.1 from security patch (#208587) + +* Sun Sep 24 2006 Jindrich Novy 10.35-2 +- fix ppmquantall (#207799), thanks to Steve Grubb + +* Mon Sep 18 2006 Jindrich Novy 10.35-1 +- update to 10.35 +- drop .pnmtopng, .rgbtxt patches, fixed upstream +- sync .xwidfix, .ppmtompeg patches +- regenerate man pages + +* Thu Sep 14 2006 Jindrich Novy 10.34-8 +- readd pbmtols, author claims it's LGPL (#202519) +- add .l1 suffixes to tarball names to reflect legal fixes + in the upstream release with the same NVR + +* Wed Sep 13 2006 Jindrich Novy 10.34-7 +- rebuild + +* Thu Sep 7 2006 Jindrich Novy 10.34-6.fc6 +- regenerate man pages so that makewhatis isn't confused (#204991) + (upstream makeman script was broken -> now fixed) + +* Mon Sep 4 2006 Jindrich Novy 10.34-5.fc6 +- readd spottopgm, author claims it's GPL (#202519) + +* Tue Aug 15 2006 Jindrich Novy 10.34-4.fc6 +- legal fixes (#202519): +- remove pbmtols, spottopgm, jbig and hpcd stuff from source + and doc tarballs + +* Sat Aug 12 2006 Jindrich Novy 10.34-3.fc6 +- pamscale won't waste all system resources by usage of uninitialized + variables for output image resolution (#199871) +- use %%{?dist} + +* Wed Jul 19 2006 Jindrich Novy 10.34-2 +- fix double free corruption in ppmtompeg (#199409), + thanks to Milan Zazrivec + +* Wed Jul 12 2006 Jesse Keating - 10.34-1.1 +- rebuild + +* Thu Jun 22 2006 Jindrich Novy 10.34-1 +- update to 10.34 +- drop .ppmtogif, .nstring patches +- remove some overflow checks from .security patch, it's + now resolved in the new upstream version +- don't use svgalib by default (don't compile/ship ppmsvgalib) +- don't compile svgtopam because of the libxml dependency +- add BuildRequires libX11-devel +- fix build on x86_64 and ppc64 + +* Mon Jun 5 2006 Jindrich Novy 10.33-3 +- fix multilib conflict (#192735) +- remove jbigtopnm man page + +* Fri Apr 14 2006 Jindrich Novy 10.33-2 +- fix image corruption in ppmtogif, thanks to Gilles Detillieux (#188597) +- fix nsting.h to let pnmtopng and other utilities using seekable opening + mode work on x86_64 (#188594) + +* Wed Apr 5 2006 Jindrich Novy 10.33-1 +- update to 10.33 +- drop upstreamed .ppmdepth patch +- fix segfault in ppmtompeg when encoding jpeg images (#185970) + +* Mon Apr 3 2006 Jindrich Novy 10.32-2 +- fix broken symlink in upstream: pnmsdepth -> pamdepth (#187667) + +* Tue Feb 28 2006 Jindrich Novy 10.32-1 +- update to 10.32 +- drop .msbmp patch, applied upstream +- sync the rest of the patches +- regenerate man pages + +* Mon Feb 20 2006 Jindrich Novy 10.31-5 +- add missing flex BuildRequires +- fix anytopnm to recognize ms-bmp files (#182060) + +* Tue Feb 14 2006 Jindrich Novy 10.31-4 +- make xwdtopnm work on x86_64 (#181001) + +* Fri Feb 10 2006 Jesse Keating - 10.31-3.1 +- bump again for double-long bug on ppc(64) + +* Fri Feb 10 2006 Jindrich Novy 10.31-3 +- fix segfault caused by usage of uninitialized variables while + parsing cmdline arguments in pnmtopng (#179645) +- add validity check for date/time in pnmtopng +- fix unchecked sscanf reads + +* Tue Feb 07 2006 Jesse Keating - 10.31-2.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Wed Jan 18 2006 Jindrich Novy 10.31-2 +- rebuild to have greater version than in FC4 (#177698) + +* Fri Dec 30 2005 Jindrich Novy 10.31-1 +- update to 10.31 +- update security patch +- regenerate man pages + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Tue Nov 29 2005 Jindrich Novy 10.30-2 +- fix path to rgb.txt to fit modular X (#174128) + +* Fri Oct 21 2005 Jindrich Novy 10.30-1 +- update to 10.30 +- update manpath, gcc4 patches +- update security patch - fixed length problem in rle_addhist +- update partly upstreamed bmptopnm, pnmtopng patches +- drop manpath patch +- regenerate man pages + +* Thu Oct 06 2005 Jindrich Novy 10.29-2 +- fix segfault in pnmtopng caused by referencing a NULL pointer (#169532) + +* Tue Aug 16 2005 Jindrich Novy 10.29-1 +- update to 10.29 +- drop upstreamed .libpm, .pnmtojpeg, .pbmtolj patches +- update .CAN-2005-2471 patch + +* Mon Aug 15 2005 Jindrich Novy 10.28-6 +- link libnetpbm.so against -lm (#165980) + +* Tue Aug 09 2005 Jindrich Novy 10.28-5 +- fix CAN-2005-2471, unsafe gs calls from pstopnm (#165355) + +* Thu Jul 21 2005 Jindrich Novy 10.28-4 +- fix buffer overflow in pbmtolj (#163596) + +* Mon Jun 27 2005 Jindrich Novy 10.28-3 +- create symlink pnmtopnm -> pamtopnm, this works now in + netpbm-10.28 (#161436) + +* Tue Jun 21 2005 Jindrich Novy 10.28-2 +- fix segfault in pbmtolj caused by unchecked assertions + caused by definition of NDEBUG (#160429) +- drop hunk from .security patch causing dual inclusion + of string.h in pbmtolj.c + +* Fri Jun 10 2005 Jindrich Novy 10.28-1 +- update to 10.28 +- regenerated man pages +- sync .security, .security2, .badlink, .libpm, .gcc4 patches +- drop upstreamed .pngtopnm, .pnmcolormap patches + +* Tue May 31 2005 Jindrich Novy 10.27-4 +- fix segfault in pnmcolormap what makes latex2html/ppmquant + unusable (#158665, #139111) + +* Mon May 16 2005 Jindrich Novy 10.27-3 +- fix ppmdither leak caused by bug in security patch (#157757) +- drop gcc34 patch + +* Mon May 09 2005 Jindrich Novy 10.27-2 +- fix invalid strcmp condition in bmptopnm, typo in pnmtojpeg + (David Constanzo, #157106, #157118) +- proper read longs and shorts in libpm.c (David Constanzo, #157110) +- fix segfault in bmptopnm caused by freeing an uninitialized pointer + +* Tue Mar 29 2005 Jindrich Novy 10.27-1 +- update to the new 10.27 release +- update .security2, .security patch +- regenerate man pages +- remove jbig, hpcd +- remove config_template from /usr +- don't create symlink to pamtopnm + +* Mon Mar 14 2005 Jindrich Novy 10.26.4-3 +- fix overflow checking of integers with incompatible endianess + causing problems using xwdtopnm (#147790) + +* Wed Mar 09 2005 Jindrich Novy 10.26.4-2 +- add .gcc4 patch to fix some missing declarations of headers, + some pointer signedness mismatches, remove xmalloc2 +- rebuilt with gcc4 + +* Thu Mar 03 2005 Jindrich Novy 10.26.4-1 +- update to netpbm-10.26.4, remove jbig, hpcd +- this version fixes #149924 +- regenerate man pages (don't include man pages without binaries - #146863) + +* Wed Jan 05 2005 Jindrich Novy 10.26-1 +- update to netpbm-10.26-1, remove jbig, hpcd +- regenerate man pages, remove man pages for non existent binaries +- update security patch, additional fixes +- drop upstreamed misc patch, merge malloc patch with security patch + +* Mon Oct 25 2004 Jindrich Novy 10.25-3 +- include man pages in troff format, thanks to Michal Jaegerman (#136959) +- drop bmpbpp patch, fixed upstream +- remove pcdovtoppm, ppmsvgalib, vidtoppm man pages because binaries + for them are not present (#136471) + +* Mon Oct 18 2004 Jindrich Novy 10.25-2 +- avoid compile crash when "-msse" is in CFLAGS + +* Mon Oct 18 2004 Jindrich Novy 10.25-1 +- update to latest upstream 10.25 +- drop initvar patch +- update security, misc patch +- add bmpbpp patch to use only appropriate bit depths for BMP (#135675) + +* Thu Sep 23 2004 Jindrich Novy 10.24-3 +- added patch to suppress installation of doc.url to /usr/bin #133346 + +* Wed Aug 18 2004 Jindrich Novy 10.24-2 +- added patch to fix compile crash for 64bit machines +- various hacks related to .security patch + +* Mon Aug 16 2004 Jindrich Novy 10.24-1 +- updated to 10.24 +- updated docs + +* Thu Aug 05 2004 Jindrich Novy 10.23-2 +- added pngtopnm patch +- added malloc patch + +* Tue Aug 03 2004 Jindrich Novy 10.23-1 +- updated to netpbm-10.23 upsteam (and removed jbig, hpcd) +- $TMPDIR patch removed, obsolete +- updated gcc34 patch +- removed nestedfunc patch, already applied in upstream version +- updated security patch to conform to 10.23 (mostly in ppmtompeg/frame.c) + +* Fri Jul 02 2004 Phil Knirsch 10.22-2 +- Fixed Zero byte allocation error in bmptopnm (#123169) +- Honour the $TMPDIR in ppmfade (#117247) +- Fixed nested function bug (#117377) +- Fixed several uninitialized variables (#117377) + +* Mon Jun 28 2004 Phil Knirsch 10.22-1 +- Update to latest upstream version 10.22 (also for docs). +- Removed jbig and hdcp code from tarball. + +* Sat Jun 19 2004 Alan Cox +- merged fix for pnmrotate crash freeing wrong number of rows + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Tue Mar 30 2004 Harald Hoyer - 10.19-7 +- fixed compilation with gcc34 + +* Tue Mar 02 2004 Elliot Lee +- rebuilt + +* Tue Feb 17 2004 Phil Knirsch 10.19-6 +- Fixed problem in pnmquant with GetOptions() and args/ARGV (#115788). + +* Fri Feb 13 2004 Elliot Lee 10.19-5 +- rebuilt + +* Tue Feb 10 2004 Phil Knirsch 10.19-4 +- Fixed several tmp vulnerabilities in scripts and apps. Based on Debian + security fix for netpbm-9.24. + +* Mon Feb 09 2004 Phil Knirsch 10.19-3 +- Included doc tarball with manpages (#114755). +- Fixed small manpage incorrectness (#84922). +- Fixed message from giftopnm (#114756). + +* Fri Jan 30 2004 Phil Knirsch 10.19-2 +- No need anymore to fix ppmfade and ppmshade. + +* Thu Jan 29 2004 Phil Knirsch 10.19-1 +- Major update to latest upstream version 10.19. + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Fri Feb 28 2003 Phil Knirsch 9.24-11 +- Updated Alan's patch. + +* Wed Feb 19 2003 Phil Knirsch 9.24-10 +- Added big security patch by Alan Cox. + +* Wed Jan 22 2003 Tim Powers 9.24-9 +- rebuilt + +* Thu Dec 19 2002 Phil Knirsch 9.24-8 +- Removed print filters again as they are too dangerous. + +* Mon Dec 16 2002 Elliot Lee 9.24-7 +- Merge in hammer changes, rebuild + +* Sun Sep 08 2002 Arjan van de Ven +- fix for x86-64 + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Wed Jun 19 2002 Phil Knirsch 9.24-5 +- Don't forcibly strip binaries + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Tue Apr 09 2002 Phil Knirsch 9.24-3 +- Fixed a possible gcc compiler problem for inline struct parameters (#62181). +- Added missing .map files to progs files selection (#61625). + +* Tue Apr 02 2002 Phil Knirsch 9.24-2 +- Fixed stupid dangling symlink problem (#62478) + +* Tue Mar 12 2002 Phil Knirsch 9.24-1 +- Updated to netpbm version 9.24 +- Hacked around a couple of library problems. + +* Tue Nov 06 2001 Phil Knirsch +- Updated to netpbm version 9.20 + +* Fri Jun 22 2001 Philipp Knirsch +- Updated to netpbm version 9.14 +- Removed pnmtotiff resize patch as it is now part of the original package +- Removed pstopnm csh fix as it is now part of the original package +- Removed asciitopgm memcpy fix as it is now part of the original package +- Removed manpages patch as it is now part of the original package + +* Mon Feb 12 2001 Philipp Knirsch +- Fixed bugzilla bug #26767 where the new glibc time and sys/time fixes needed + to be done. + +* Fri Feb 9 2001 Crutcher Dunnavant +- switched filters to printconf filters + +* Wed Jan 24 2001 Philipp Knirsch +- Fixed bugzilla bug #21644 where few manpages had a small error. + +* Tue Dec 19 2000 Philipp Knirsch +- Fixed bugzilla bug #19487 where asciitopgm dumped core on Alpha. Actually + dumped core everywhere + +* Tue Dec 19 2000 Philipp Knirsch +- update to 9.9 +- Due to patent infringement problems removed the jbig support from the tarball + (pnm/jbig + Makefile changes) and created a new tarball + +* Wed Oct 25 2000 Nalin Dahyabhai +- include shared libraries missing from previous build + +* Tue Oct 24 2000 Nalin Dahyabhai +- update to 9.8 +- make sure shhopt.h is included in the -devel package (#19672) +- rename shhopt.h to pbmshhopt.h because it's not the same as the normal + shhopt.h that other things (like util-linux) expect + +* Wed Aug 9 2000 Crutcher Dunnavant +- added a png-to-pnm.fpi filter + +* Wed Aug 2 2000 Matt Wilson +- rebuilt against new libpng + +* Mon Jul 17 2000 Nalin Dahyabhai +- move netpbm-progs to the Applications/Multimedia group +- reintroduce patches from the old libgr package + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Sat Jul 1 2000 Nalin Dahyabhai +- update to 9.5 + +* Tue Jun 27 2000 Nalin Dahyabhai +- update to 9.4 + +* Sat Jun 3 2000 Nalin Dahyabhai +- switch back to the netpbm tree, which is maintained again + +* Mon Feb 14 2000 Nalin Dahyabhai +- make sure all man pages are included (#9328) +- fix pstopnm bomb when xres == yres (#9329) +- add libjpeg and libz because libtiff now needs them + +* Wed Feb 02 2000 Nalin Dahyabhai +- added/updated TIFF compression patch from jik@kamens.brookline.ma.us (#8826) + +* Mon Dec 06 1999 Michael K. Johnson +- added TIFF resolution patch from jik@kamens.brookline.ma.us (#7589) + +* Mon Sep 20 1999 Michael K. Johnson +- added section 5 man pages + +* Fri Jul 30 1999 Bill Nottingham +- fix tiff-to-pnm.fpi (#4267) + +* Thu Jul 29 1999 Bill Nottingham +- add a pile of foo-to-bar.fpi filters (#4251) + +* Tue Mar 23 1999 Michael Johnson +- removed old png.h header file that was causing png utils to die +- build png in build instead of install section... + +* Mon Mar 22 1999 Bill Nottingham +- patch for 24-bit .BMP files (from sam@campbellsci.co.uk) + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 15) + +* Wed Jan 06 1999 Cristian Gafton +- clean up the spec file +- build for glibc 2.1 +- patch to fix pktopbm + +* Wed Jun 10 1998 Prospector System +- translations modified for de + +* Wed Jun 10 1998 Jeff Johnson +- glibc2 defines random in (pbm/pbmplus.h problem #693) + +* Thu May 07 1998 Prospector System +- translations modified for de, fr, tr + +* Thu May 07 1998 Cristian Gafton +- cleaned up the spec file a little bit +- validated mike's changes :-) + +* Wed May 6 1998 Michael Maher +- added pnm-to-ps.fpi that was missing from previous packages + +* Thu Apr 30 1998 Cristian Gafton +- altered install so that the package installs now even if a previous + version was not installed on the system + +* Thu Apr 16 1998 Erik Troan +- built against libpng 1.0 + +* Thu Nov 06 1997 Donnie Barnes +- changed copyright from "distributable" to "freeware" +- added some missing scripts that existed in netpbm +- added some binaries that weren't getting built +- added patch to build tiff manipulation progs (requires libtiff) + +* Wed Oct 15 1997 Donnie Barnes +- obsoletes netpbm now + +* Tue Oct 14 1997 Erik Troan +- mucked config.guess and Make.Rules to build on Alpha/Linux + +* Tue Oct 07 1997 Donnie Barnes +- updated to 2.0.13 +- dropped libjpeg and libtiff (those should come from home sources) +- removed glibc patch (new version appears to have it!) +- added i686 as a valid arch type to config.guess + +* Thu Jul 10 1997 Erik Troan +- built against glibc +