Compare commits

...

No commits in common. 'c9' and 'i10c-beta' have entirely different histories.

2
.gitignore vendored

@ -1 +1 @@
SOURCES/netpbm-10.95.00.tar.xz SOURCES/netpbm-11.02.00.tar.xz

@ -1 +1 @@
05fc8e8e42f4905bf859607aa6a7d9744174a711 SOURCES/netpbm-10.95.00.tar.xz b4fd2a59117a8d31c44e5cab9231f124368f2b95 SOURCES/netpbm-11.02.00.tar.xz

@ -0,0 +1,41 @@
Remove the contents of libjasper_compat.c. The assignment
*errorP = errorP;
is bogus because it creates a non-null value in *errorP even on
success, and the caller expects a null pointer int his case.
The source file is compiled, but not actually linked in, so this is
only a problem because of the type error that fails the build.
diff --git a/converter/other/jpeg2000/libjasper_compat.c b/converter/other/jpeg2000/libjasper_compat.c
index 101820a321212dc6..e69de29bb2d1d643 100644
--- a/converter/other/jpeg2000/libjasper_compat.c
+++ b/converter/other/jpeg2000/libjasper_compat.c
@@ -1,26 +0,0 @@
-#include "netpbm/nstring.h"
-
-#include "jasper/jasper.h"
-#include "jasper/jas_image.h"
-
-#ifndef JAS_HAVE_PMJAS_IMAGE_DECODE
-
-void
-pmjas_image_decode(jas_stream_t * const in,
- int const fmtArg,
- const char * const optstr,
- jas_image_t ** const imagePP,
- const char ** const errorP) {
-
- jas_image_t * const jasperP = jas_image_decode(in, fmtArg, optstr);
-
- if (jasperP) {
- *imagePP = jasperP;
- *errorP = errorP;
- } else {
- pm_asprintf(errorP, "Failed. Details may have been written to "
- "Standard Error");
- }
-}
-
-#endif

@ -0,0 +1,46 @@
Include "pm.h" for the declaration of the overflow_add function. This
avoids an implicit function declaration. Future C compilers will
require that all functions are declared explicitly. Implicit function
declarations are a language feature that was removed in 1999.
Likewise, include "pm.h" for the newly added declarations of realloc2.
This fixes a pointer truncation bug in pjtoppm.
Both issues are specific to downstream patches.
diff --git a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
index 1c8d236219b297e1..d63cab63b13f2051 100644
--- a/converter/pbm/pbmtoppa/pbm.c
+++ b/converter/pbm/pbmtoppa/pbm.c
@@ -12,6 +12,7 @@
#include <stdlib.h>
#include <string.h>
+#include "pm.h"
#include "ppapbm.h"
int make_pbm_stat(pbm_stat* pbm,FILE* fptr)
diff --git a/converter/ppm/pjtoppm.c b/converter/ppm/pjtoppm.c
index c458c06457c2b9bd..5e93a6acb8d6f198 100644
--- a/converter/ppm/pjtoppm.c
+++ b/converter/ppm/pjtoppm.c
@@ -10,6 +10,7 @@
** implied warranty.
*/
+#include "pm.h"
#include "ppm.h"
#include "mallocvar.h"
diff --git a/lib/pm.h b/lib/pm.h
index 5037c2519c565fbc..435445d5e7f52fbf 100644
--- a/lib/pm.h
+++ b/lib/pm.h
@@ -457,6 +457,7 @@ pm_parse_height(const char * const arg);
void *malloc2(int, int);
void *malloc3(int, int, int);
+void *realloc2(void * a, int b, int c);
#define overflow2(a,b) __overflow2(a,b)
void __overflow2(int, int);
void overflow3(int, int, int);

@ -1,21 +0,0 @@
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 <stdint.h>
#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;

@ -1,6 +1,6 @@
diff -urNp a/userguide/avstopam.html b/userguide/avstopam.html diff -urNp a/userguide/avstopam.html b/userguide/avstopam.html
--- a/userguide/avstopam.html 2021-06-02 12:56:59.584286425 +0200 --- a/userguide/avstopam.html 2022-01-03 16:56:37.731614243 +0100
+++ b/userguide/avstopam.html 2021-06-02 15:00:33.799300026 +0200 +++ b/userguide/avstopam.html 2022-01-03 16:58:29.889416006 +0100
@@ -2,12 +2,13 @@ @@ -2,12 +2,13 @@
<html><head><title>Avstopam User Manual</title></head> <html><head><title>Avstopam User Manual</title></head>
<body> <body>
@ -72,8 +72,8 @@ diff -urNp a/userguide/avstopam.html b/userguide/avstopam.html
</body> </body>
</html> </html>
diff -urNp a/userguide/faxformat.html b/userguide/faxformat.html diff -urNp a/userguide/faxformat.html b/userguide/faxformat.html
--- a/userguide/faxformat.html 2021-06-02 12:56:59.576286351 +0200 --- a/userguide/faxformat.html 2022-01-03 16:56:37.731614243 +0100
+++ b/userguide/faxformat.html 2021-06-02 15:02:58.710711998 +0200 +++ b/userguide/faxformat.html 2022-01-03 16:58:29.890416013 +0100
@@ -5,10 +5,11 @@ @@ -5,10 +5,11 @@
Updated: 03 December 2008 Updated: 03 December 2008
<br> <br>
@ -88,8 +88,8 @@ diff -urNp a/userguide/faxformat.html b/userguide/faxformat.html
(the idea is to provide a way to be sure that a fax machine is able to receive (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 a fax sent by another). These standards incidentally specify graphics file
diff -urNp a/userguide/libnetpbm_ug.html b/userguide/libnetpbm_ug.html diff -urNp a/userguide/libnetpbm_ug.html b/userguide/libnetpbm_ug.html
--- a/userguide/libnetpbm_ug.html 2021-06-02 12:56:59.584286425 +0200 --- a/userguide/libnetpbm_ug.html 2022-01-03 16:56:37.732614250 +0100
+++ b/userguide/libnetpbm_ug.html 2021-06-02 14:36:35.392293125 +0200 +++ b/userguide/libnetpbm_ug.html 2022-01-03 16:58:29.891416020 +0100
@@ -374,7 +374,7 @@ plain format. @@ -374,7 +374,7 @@ plain format.
<h2 id="reference">Reference</h2> <h2 id="reference">Reference</h2>
@ -100,8 +100,8 @@ diff -urNp a/userguide/libnetpbm_ug.html b/userguide/libnetpbm_ug.html
<p>The <a href="libpm.html">Libnetpbm Utility Manual</a> <p>The <a href="libpm.html">Libnetpbm Utility Manual</a>
diff -urNp a/userguide/pamfunc.html b/userguide/pamfunc.html diff -urNp a/userguide/pamfunc.html b/userguide/pamfunc.html
--- a/userguide/pamfunc.html 2021-06-02 12:56:59.585286434 +0200 --- a/userguide/pamfunc.html 2022-01-03 16:56:37.730614236 +0100
+++ b/userguide/pamfunc.html 2021-06-02 14:40:09.474375441 +0200 +++ b/userguide/pamfunc.html 2022-01-03 16:58:29.892416027 +0100
@@ -60,7 +60,7 @@ output image. @@ -60,7 +60,7 @@ output image.
and bit string (such as and with 01001000). For the arithmetic functions, the 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 function arguments and results are the fraction that a sample is of the
@ -112,8 +112,8 @@ diff -urNp a/userguide/pamfunc.html b/userguide/pamfunc.html
<h4>Arithmetic functions</h4> <h4>Arithmetic functions</h4>
diff -urNp a/userguide/pammixmulti.html b/userguide/pammixmulti.html diff -urNp a/userguide/pammixmulti.html b/userguide/pammixmulti.html
--- a/userguide/pammixmulti.html 2021-06-02 12:56:59.586286443 +0200 --- a/userguide/pammixmulti.html 2022-01-03 16:56:37.731614243 +0100
+++ b/userguide/pammixmulti.html 2021-06-02 14:28:03.105311615 +0200 +++ b/userguide/pammixmulti.html 2022-01-03 16:58:29.893416034 +0100
@@ -7,8 +7,8 @@ Updated: 18 November 2018 @@ -7,8 +7,8 @@ Updated: 18 November 2018
<a href="#index">Table Of Contents</a> <a href="#index">Table Of Contents</a>
@ -278,17 +278,10 @@ diff -urNp a/userguide/pammixmulti.html b/userguide/pammixmulti.html
</body> </body>
diff -urNp a/userguide/pampaintspill.html b/userguide/pampaintspill.html diff -urNp a/userguide/pampaintspill.html b/userguide/pampaintspill.html
--- a/userguide/pampaintspill.html 2021-06-02 12:56:59.575286342 +0200 --- a/userguide/pampaintspill.html 2022-01-03 16:56:37.730614236 +0100
+++ b/userguide/pampaintspill.html 2021-06-02 15:06:31.354767352 +0200 +++ b/userguide/pampaintspill.html 2022-01-03 17:05:08.124277395 +0100
@@ -2,12 +2,12 @@ @@ -7,7 +7,7 @@ Updated: 02 November 2021
<html><head><title>Pampaintspill User Manual</title></head> <a href="#index">Table Of Contents</a>
<body>
<h1>pampaintspill</h1>
-Updated: 06 March 2021
+<p>Updated: 06 March 2021
<br>
-<a href="#index">Table Of Contents</a>
+<a href="#index">Table Of Contents</a></p>
<h2>NAME</h2> <h2>NAME</h2>
-pampaintspill - smoothly spill colors into the background -pampaintspill - smoothly spill colors into the background
@ -296,9 +289,9 @@ diff -urNp a/userguide/pampaintspill.html b/userguide/pampaintspill.html
<h2 id="synopsis">SYNOPSIS</h2> <h2 id="synopsis">SYNOPSIS</h2>
@@ -17,17 +17,17 @@ pampaintspill - smoothly spill colors in @@ -19,17 +19,17 @@ pampaintspill - smoothly spill colors in
[<b>--wrap</b>] [<b>--all</b>]
[<b>--downsample</b>=<i>number</i>] [<b>--downsample</b>=<i>number</i>]
[<b>--near</b>=<i>number</i>]
[<b>--power</b>=<i>number</i>] [<i>filename</i>] [<b>--power</b>=<i>number</i>] [<i>filename</i>]
-[<b>-randomseed=</b><i>integer</i>] -[<b>-randomseed=</b><i>integer</i>]
+[<b>-randomseed=</b><i>integer</i>]</p> +[<b>-randomseed=</b><i>integer</i>]</p>
@ -317,7 +310,7 @@ diff -urNp a/userguide/pampaintspill.html b/userguide/pampaintspill.html
<p><b>pampaintspill</b> produces a smooth color gradient from all of the <p><b>pampaintspill</b> produces a smooth color gradient from all of the
non-background-colored pixels in an input image, effectively "spilling non-background-colored pixels in an input image, effectively "spilling
@@ -38,27 +38,27 @@ paint" onto the background. <b>pampaint @@ -40,27 +40,27 @@ paint" onto the background. <b>pampaint
<li><b>pampaintspill</b> accepts any number of paint <li><b>pampaintspill</b> accepts any number of paint
sources (non-background-colored pixels), which can lie anywhere sources (non-background-colored pixels), which can lie anywhere
on the canvas. <b>pamgradient</b> accepts exactly on the canvas. <b>pamgradient</b> accepts exactly
@ -350,14 +343,20 @@ diff -urNp a/userguide/pampaintspill.html b/userguide/pampaintspill.html
<dl> <dl>
<dt><b>--bgcolor</b>=<i>color</i></dt> <dt><b>--bgcolor</b>=<i>color</i></dt>
@@ -107,42 +107,42 @@ command line options: @@ -116,46 +116,46 @@ command line options:
2.0) make the paint sources stand out in the output image by pushing the
gradients away from them.</dd>
- <dt><b>-randomseed=</b><i>integer</i>
+ <dt><b>-randomseed=</b><i>integer</i></dt>
<dd>This is the seed for the random number generator that generates the <dd>This is the seed for the random number generator that generates the
pixels. - pixels.
+ pixels.</dd>
- <p>Use this to ensure you get the same image on separate invocations. - <p>Use this to ensure you get the same image on separate invocations.
+ <p>Use this to ensure you get the same image on separate invocations.</p> + <p>Use this to ensure you get the same image on separate invocations.</p>
- <p>This option was new in Netpbm 10.94 (March 2021). - <p>This option was new in Netpbm 10.94 (March 2021).</dd>
+ <p>This option was new in Netpbm 10.94 (March 2021).</p> + <p>This option was new in Netpbm 10.94 (March 2021).</p>
</dl> </dl>
@ -387,7 +386,7 @@ diff -urNp a/userguide/pampaintspill.html b/userguide/pampaintspill.html
<h2 id="copyright">COPYRIGHT</h2> <h2 id="copyright">COPYRIGHT</h2>
<p>Copyright&nbsp;&copy; 2010 Scott Pakin, <p>Copyright&nbsp;&copy; 2010&ndash;2021 Scott Pakin,
-<a href="mailto:scott+pbm@pakin.org"><i>scott+pbm@pakin.org</i></a>. -<a href="mailto:scott+pbm@pakin.org"><i>scott+pbm@pakin.org</i></a>.
+<a href="mailto:scott+pbm@pakin.org"><i>scott+pbm@pakin.org</i></a>.</p> +<a href="mailto:scott+pbm@pakin.org"><i>scott+pbm@pakin.org</i></a>.</p>
@ -410,8 +409,8 @@ diff -urNp a/userguide/pampaintspill.html b/userguide/pampaintspill.html
</body> </body>
diff -urNp a/userguide/pamrecolor.html b/userguide/pamrecolor.html diff -urNp a/userguide/pamrecolor.html b/userguide/pamrecolor.html
--- a/userguide/pamrecolor.html 2021-06-02 12:56:59.574286333 +0200 --- a/userguide/pamrecolor.html 2022-01-03 16:56:37.731614243 +0100
+++ b/userguide/pamrecolor.html 2021-06-02 15:09:53.837724488 +0200 +++ b/userguide/pamrecolor.html 2022-01-03 16:58:29.894416041 +0100
@@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
<html><head><title>Pamrecolor User Manual</title></head> <html><head><title>Pamrecolor User Manual</title></head>
<body> <body>
@ -495,8 +494,8 @@ diff -urNp a/userguide/pamrecolor.html b/userguide/pamrecolor.html
<p>The luminance values <b>pamrecolor</b> uses for each of the above come from <p>The luminance values <b>pamrecolor</b> uses for each of the above come from
Bruce Lindbloom's Bruce Lindbloom's
diff -urNp a/userguide/pbmtog3.html b/userguide/pbmtog3.html diff -urNp a/userguide/pbmtog3.html b/userguide/pbmtog3.html
--- a/userguide/pbmtog3.html 2021-06-02 12:56:59.585286434 +0200 --- a/userguide/pbmtog3.html 2022-01-03 16:56:37.732614250 +0100
+++ b/userguide/pbmtog3.html 2021-06-02 14:44:07.715692749 +0200 +++ b/userguide/pbmtog3.html 2022-01-03 16:58:29.894416041 +0100
@@ -36,7 +36,7 @@ use those encodings. @@ -36,7 +36,7 @@ use those encodings.
<p>In addition to the options common to all programs based on libnetpbm <p>In addition to the options common to all programs based on libnetpbm
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions"> (most notably <b>-quiet</b>, see <a href="index.html#commonoptions">
@ -516,8 +515,8 @@ diff -urNp a/userguide/pbmtog3.html b/userguide/pbmtog3.html
and then modified extensively by others. and then modified extensively by others.
diff -urNp a/userguide/ppmtogif.html b/userguide/ppmtogif.html diff -urNp a/userguide/ppmtogif.html b/userguide/ppmtogif.html
--- a/userguide/ppmtogif.html 2021-06-02 12:56:59.574286333 +0200 --- a/userguide/ppmtogif.html 2022-01-03 16:56:37.733614257 +0100
+++ b/userguide/ppmtogif.html 2021-06-02 15:48:19.167930575 +0200 +++ b/userguide/ppmtogif.html 2022-01-03 16:58:29.895416049 +0100
@@ -5,17 +5,17 @@ @@ -5,17 +5,17 @@
<h2>NAME</h2> <h2>NAME</h2>

@ -216,20 +216,42 @@ diff -ruNp a/converter/pbm/mdatopbm.c b/converter/pbm/mdatopbm.c
data = pbm_allocarray(nOutCols, nOutRows); data = pbm_allocarray(nOutCols, nOutRows);
diff -ruNp a/converter/pbm/mgrtopbm.c b/converter/pbm/mgrtopbm.c diff -ruNp a/converter/pbm/mgrtopbm.c b/converter/pbm/mgrtopbm.c
--- a/converter/pbm/mgrtopbm.c 2021-06-02 15:53:59.828205592 +0200 --- a/converter/pbm/mgrtopbm.c 2022-01-03 16:41:24.856969944 +0100
+++ b/converter/pbm/mgrtopbm.c 2021-06-02 20:23:21.808634248 +0200 +++ b/converter/pbm/mgrtopbm.c 2022-01-03 16:43:27.023842152 +0100
@@ -65,6 +65,8 @@ readMgrHeader(FILE * const ifP, @@ -105,6 +105,8 @@ readMgrHeader(FILE * const ifP,
if (head.h_high < ' ' || head.l_high < ' ') interpHdrWidth (head, colsP);
pm_error("Invalid width field in MGR header"); interpHdrHeight(head, rowsP);
+ overflow_add(*colsP, pad); + overflow_add(*colsP, pad);
+ +
*colsP = (((int)head.h_wide - ' ') << 6) + ((int)head.l_wide - ' '); *padrightP = ((*colsP + pad - 1) / pad) * pad - *colsP;
*rowsP = (((int)head.h_high - ' ') << 6) + ((int) head.l_high - ' '); }
*padrightP = ( ( *colsP + pad - 1 ) / pad ) * pad - *colsP;
diff -ruNp a/converter/pbm/pbmtogem.c b/converter/pbm/pbmtogem.c diff --git a/converter/pbm/pbmto4425.c b/converter/pbm/pbmto4425.c
--- a/converter/pbm/pbmtogem.c 2021-06-02 15:53:59.828205592 +0200 index 1d97ac6..c4c8cbb 100644
+++ b/converter/pbm/pbmtogem.c 2021-06-02 20:23:21.809634256 +0200 --- a/converter/pbm/pbmto4425.c
+++ b/converter/pbm/pbmto4425.c
@@ -2,6 +2,7 @@
#include "nstring.h"
#include "pbm.h"
+#include <string.h>
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 4fd30e9..c82757d 100644
--- a/converter/pbm/pbmtogem.c
+++ b/converter/pbm/pbmtogem.c
@@ -79,6 +79,7 @@ putinit (int const rows, int const cols) @@ -79,6 +79,7 @@ putinit (int const rows, int const cols)
bitsperitem = 0; bitsperitem = 0;
bitshift = 7; bitshift = 7;
@ -351,35 +373,18 @@ diff -ruNp a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
- } - }
- return retval; - return retval;
-} -}
-
+int make_pbm_stat(pbm_stat* pbm,FILE* fptr) +int make_pbm_stat(pbm_stat* pbm,FILE* fptr)
+{ +{
+ char line[1024]; + char line[1024];
+
+ pbm->fptr=fptr; + pbm->fptr=fptr;
+ pbm->version=none; + pbm->version=none;
+ pbm->current_line=0; + pbm->current_line=0;
+ pbm->unread = 0; + pbm->unread = 0;
+
+ if (fgets (line, 1024, fptr) == NULL) + if (fgets (line, 1024, fptr) == NULL)
+ return 0; + return 0;
+ line[strlen(line)-1] = 0; + line[strlen(line)-1] = 0;
+
+ if(!strcmp(line,"P1")) pbm->version=P1;
+ if(!strcmp(line,"P4")) pbm->version=P4;
+ if(pbm->version == none)
+ {
+ fprintf(stderr,"pbm_readheader(): unknown PBM magic '%s'\n",line);
+ return 0;
+ }
+
+ do
+ if (fgets (line, 1024, fptr) == NULL)
+ return 0;
+ while (line[0] == '#');
+ if (2 != sscanf (line, "%d %d", &pbm->width, &pbm->height))
+ return 0;
-static int -static int
-getbytes(FILE * const ifP, -getbytes(FILE * const ifP,
@ -418,11 +423,23 @@ diff -ruNp a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
- retval = 1; - retval = 1;
- } - }
- return retval; - return retval;
+ return 1; -}
} + if(!strcmp(line,"P1")) pbm->version=P1;
+ if(!strcmp(line,"P4")) pbm->version=P4;
+ if(pbm->version == none)
+ {
+ fprintf(stderr,"pbm_readheader(): unknown PBM magic '%s'\n",line);
+ return 0;
+ }
+ do
+ if (fgets (line, 1024, fptr) == NULL)
+ return 0;
+ while (line[0] == '#');
+ if (2 != sscanf (line, "%d %d", &pbm->width, &pbm->height))
+ return 0;
-
-
-int -int
-pbm_readline(pbm_stat * const pbmStatP, -pbm_readline(pbm_stat * const pbmStatP,
- unsigned char * const data) { - unsigned char * const data) {
@ -469,6 +486,11 @@ diff -ruNp a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
- retval = 0; - retval = 0;
- } - }
- } - }
- }
- return retval;
+ return 1;
}
+static int getbytes(FILE *fptr,int width,unsigned char* data) +static int getbytes(FILE *fptr,int width,unsigned char* data)
+{ +{
+ unsigned char mask,acc,*place; + unsigned char mask,acc,*place;
@ -493,13 +515,12 @@ diff -ruNp a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
+ acc=0; + acc=0;
+ mask=0x80; + mask=0x80;
+ } + }
} + }
- return retval;
+ } + }
+ if(width%8) + if(width%8)
+ *place=acc; + *place=acc;
+ return 1; + return 1;
} +}
+/* Reads a single line into data which must be at least (pbm->width+7)/8 +/* Reads a single line into data which must be at least (pbm->width+7)/8
+ bytes of storage */ + bytes of storage */
@ -519,16 +540,6 @@ diff -ruNp a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
+ return 1; + return 1;
+ } + }
+ switch(pbm->version)
+ {
+ case P1:
+ if(getbytes(pbm->fptr,pbm->width,data))
+ {
+ pbm->current_line++;
+ return 1;
+ }
+ return 0;
-void -void
-pbm_unreadline(pbm_stat * const pbmStatP, -pbm_unreadline(pbm_stat * const pbmStatP,
- void * const data) { - void * const data) {
@ -542,6 +553,17 @@ diff -ruNp a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
- pbmStatP->revdata = malloc ((pbmStatP->width+7)/8); - pbmStatP->revdata = malloc ((pbmStatP->width+7)/8);
- memcpy(pbmStatP->revdata, data, (pbmStatP->width+7)/8); - memcpy(pbmStatP->revdata, data, (pbmStatP->width+7)/8);
- --pbmStatP->current_line; - --pbmStatP->current_line;
+ switch(pbm->version)
+ {
+ case P1:
+ if(getbytes(pbm->fptr,pbm->width,data))
+ {
+ pbm->current_line++;
+ return 1;
}
-}
+ return 0;
+
+ case P4: + case P4:
+ overflow_add(pbm->width, 7); + overflow_add(pbm->width, 7);
+ tmp=(pbm->width+7)/8; + tmp=(pbm->width+7)/8;
@ -550,8 +572,7 @@ diff -ruNp a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
+ { + {
+ pbm->current_line++; + pbm->current_line++;
+ return 1; + return 1;
} + }
-}
+ fprintf(stderr,"pbm_readline(): error reading line data (%d)\n",tmp2); + fprintf(stderr,"pbm_readline(): error reading line data (%d)\n",tmp2);
+ return 0; + return 0;
@ -597,29 +618,10 @@ diff -ruNp a/converter/pbm/pbmtoxbm.c b/converter/pbm/pbmtoxbm.c
putinit(xbmVersion); putinit(xbmVersion);
diff -ruNp a/converter/pbm/pbmto4425.c b/converter/pbm/pbmto4425.c diff --git a/converter/pbm/pktopbm.c b/converter/pbm/pktopbm.c
--- a/converter/pbm/pbmto4425.c 2021-06-02 15:53:59.827205582 +0200 index 712f339..b6fcb02 100644
+++ b/converter/pbm/pbmto4425.c 2021-06-02 20:23:21.808634248 +0200 --- a/converter/pbm/pktopbm.c
@@ -2,6 +2,7 @@ +++ b/converter/pbm/pktopbm.c
#include "nstring.h"
#include "pbm.h"
+#include <string.h>
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 -ruNp a/converter/pbm/pktopbm.c b/converter/pbm/pktopbm.c
--- a/converter/pbm/pktopbm.c 2021-06-02 15:53:59.828205592 +0200
+++ b/converter/pbm/pktopbm.c 2021-06-02 20:23:21.813634291 +0200
@@ -280,6 +280,7 @@ main(int argc, char *argv[]) { @@ -280,6 +280,7 @@ main(int argc, char *argv[]) {
if (flagbyte == 7) { /* long form preamble */ if (flagbyte == 7) { /* long form preamble */
integer packetlength = get32() ; /* character packet length */ integer packetlength = get32() ; /* character packet length */
@ -652,12 +654,13 @@ diff -ruNp a/converter/pbm/thinkjettopbm.l b/converter/pbm/thinkjettopbm.l
packed_bitrow = malloc(maxRowLength); packed_bitrow = malloc(maxRowLength);
diff -ruNp a/converter/pbm/ybmtopbm.c b/converter/pbm/ybmtopbm.c diff -ruNp a/converter/pbm/ybmtopbm.c b/converter/pbm/ybmtopbm.c
--- a/converter/pbm/ybmtopbm.c 2021-06-02 15:53:59.827205582 +0200 --- a/converter/pbm/ybmtopbm.c 2022-01-03 16:41:24.857969951 +0100
+++ b/converter/pbm/ybmtopbm.c 2021-06-02 20:23:21.814634300 +0200 +++ b/converter/pbm/ybmtopbm.c 2022-01-03 16:42:59.671646876 +0100
@@ -43,6 +43,7 @@ getinit(FILE * const ifP, @@ -49,6 +49,8 @@ getinit(FILE * const ifP,
pm_error("EOF / read error"); *colsP = (unsigned int) cols;
*rowsP = (unsigned int) rows;
*depthP = 1; *depthP = 1;
+
+ overflow_add(*colsP, 15); + overflow_add(*colsP, 15);
} }
@ -693,9 +696,23 @@ diff -ruNp a/converter/pgm/psidtopgm.c b/converter/pgm/psidtopgm.c
grayrow = pgm_allocrow((cols + 7) / 8 * 8); grayrow = pgm_allocrow((cols + 7) / 8 * 8);
for (row = 0; row < rows; ++row) { for (row = 0; row < rows; ++row) {
unsigned int col; unsigned int col;
diff -ruNp a/converter/ppm/ilbmtoppm.c b/converter/ppm/ilbmtoppm.c diff --git a/converter/ppm/Makefile b/converter/ppm/Makefile
--- a/converter/ppm/ilbmtoppm.c 2021-06-02 15:53:59.846205765 +0200 index 003ef8d..b97349d 100644
+++ b/converter/ppm/ilbmtoppm.c 2021-06-02 20:23:21.817634326 +0200 --- 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 b9b8986..f4fe331 100644
--- a/converter/ppm/ilbmtoppm.c
+++ b/converter/ppm/ilbmtoppm.c
@@ -608,6 +608,7 @@ decode_row(FILE * const ifP, @@ -608,6 +608,7 @@ decode_row(FILE * const ifP,
rawtype *chp; rawtype *chp;
@ -785,22 +802,11 @@ diff -ruNp a/converter/ppm/imgtoppm.c b/converter/ppm/imgtoppm.c
if ( len != cols * rows ) if ( len != cols * rows )
pm_message( pm_message(
"pixel data length (%d) does not match image size (%d)", "pixel data length (%d) does not match image size (%d)",
diff -ruNp a/converter/ppm/Makefile b/converter/ppm/Makefile diff --git a/converter/ppm/pcxtoppm.c b/converter/ppm/pcxtoppm.c
--- a/converter/ppm/Makefile 2021-06-02 15:53:59.846205765 +0200 index e252ba2..270ae3b 100644
+++ b/converter/ppm/Makefile 2021-06-02 20:23:21.815634309 +0200 --- a/converter/ppm/pcxtoppm.c
@@ -11,7 +11,7 @@ SUBDIRS = hpcdtoppm ppmtompeg +++ b/converter/ppm/pcxtoppm.c
@@ -409,6 +409,7 @@ pcx_planes_to_pixels(pixels, bitplanes, bytesperline, planes, bitsperpixel)
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 -ruNp a/converter/ppm/pcxtoppm.c b/converter/ppm/pcxtoppm.c
--- a/converter/ppm/pcxtoppm.c 2021-06-02 15:53:59.846205765 +0200
+++ b/converter/ppm/pcxtoppm.c 2021-06-02 20:23:21.818634335 +0200
@@ -409,6 +409,7 @@ pcx_planes_to_pixels(pixels, bitplanes,
/* /*
* clear the pixel buffer * clear the pixel buffer
*/ */
@ -1427,6 +1433,9 @@ diff -ruNp a/converter/ppm/ppmtopcx.c b/converter/ppm/ppmtopcx.c
- putword(yPos, ofP); /* y1 - image top */ - putword(yPos, ofP); /* y1 - image top */
- putword(xPos+cols-1, ofP); /* x2 - image right */ - putword(xPos+cols-1, ofP); /* x2 - image right */
- putword(yPos+rows-1, ofP); /* y2 - image bottom */ - putword(yPos+rows-1, ofP); /* y2 - image bottom */
-
- putword(cols, ofP); /* horizontal resolution */
- putword(rows, ofP); /* vertical resolution */
+write_header(FILE * const fp, +write_header(FILE * const fp,
+ int const cols, + int const cols,
+ int const rows, + int const rows,
@ -1447,9 +1456,7 @@ diff -ruNp a/converter/ppm/ppmtopcx.c b/converter/ppm/ppmtopcx.c
+ Putword(yPos, fp); /* y1 - image top */ + Putword(yPos, fp); /* y1 - image top */
+ Putword(xPos+cols-1, fp); /* x2 - image right */ + Putword(xPos+cols-1, fp); /* x2 - image right */
+ Putword(yPos+rows-1, fp); /* y2 - image bottom */ + Putword(yPos+rows-1, fp); /* y2 - image bottom */
+
- putword(cols, ofP); /* horizontal resolution */
- putword(rows, ofP); /* vertical resolution */
+ Putword(cols, fp); /* horizontal resolution */ + Putword(cols, fp); /* horizontal resolution */
+ Putword(rows, fp); /* vertical resolution */ + Putword(rows, fp); /* vertical resolution */
@ -1634,10 +1641,11 @@ diff -ruNp a/converter/ppm/ppmtopcx.c b/converter/ppm/ppmtopcx.c
} }
} }
} }
@@ -440,142 +453,83 @@ writeRaster16Color(FILE * const ofP, @@ -439,143 +452,84 @@ writeRaster16Color(FILE * const ofP,
static void
-static void
-ppmTo16ColorPcx(pixel ** const pixels, -ppmTo16ColorPcx(pixel ** const pixels,
- unsigned int const cols, - unsigned int const cols,
- unsigned int const rows, - unsigned int const rows,
@ -1678,7 +1686,7 @@ diff -ruNp a/converter/ppm/ppmtopcx.c b/converter/ppm/ppmtopcx.c
- -
- -
- -
-static void static void
ppmTo256ColorPcx(pixel ** const pixels, ppmTo256ColorPcx(pixel ** const pixels,
- unsigned int const cols, - unsigned int const cols,
- unsigned int const rows, - unsigned int const rows,
@ -1752,13 +1760,13 @@ diff -ruNp a/converter/ppm/ppmtopcx.c b/converter/ppm/ppmtopcx.c
- unsigned char * grnrow; - unsigned char * grnrow;
- unsigned char * blurow; - unsigned char * blurow;
- unsigned int row; - unsigned int row;
-
- MALLOCARRAY(redrow, cols);
- MALLOCARRAY(grnrow, cols);
- MALLOCARRAY(blurow, cols);
+ unsigned char *redrow, *greenrow, *bluerow; + unsigned char *redrow, *greenrow, *bluerow;
+ int col, row; + int col, row;
- MALLOCARRAY(redrow, cols);
- MALLOCARRAY(grnrow, cols);
- MALLOCARRAY(blurow, cols);
-
- if (!redrow || !grnrow || !blurow) - if (!redrow || !grnrow || !blurow)
- pm_error("Unable to allocate buffer for a row of %u pixels", cols); - pm_error("Unable to allocate buffer for a row of %u pixels", cols);
+ redrow = (unsigned char *)pm_allocrow(cols, sizeof(unsigned char)); + redrow = (unsigned char *)pm_allocrow(cols, sizeof(unsigned char));
@ -2622,20 +2630,10 @@ diff -ruNp a/editor/pnmhisteq.c b/editor/pnmhisteq.c
MALLOCARRAY(lumahist, maxval + 1); MALLOCARRAY(lumahist, maxval + 1);
if (lumahist == NULL) if (lumahist == NULL)
pm_error("Out of storage allocating array for %u histogram elements", pm_error("Out of storage allocating array for %u histogram elements",
diff -ruNp a/editor/pnmindex.csh b/editor/pnmindex.csh diff --git a/editor/pnmpad.c b/editor/pnmpad.c
--- a/editor/pnmindex.csh 2021-06-02 15:53:59.801205332 +0200 index 9fa9f9e..6b98204 100644
+++ b/editor/pnmindex.csh 2021-06-02 20:23:21.829634431 +0200 --- a/editor/pnmpad.c
@@ -1,5 +1,7 @@ +++ b/editor/pnmpad.c
#!/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 -ruNp a/editor/pnmpad.c b/editor/pnmpad.c
--- a/editor/pnmpad.c 2021-06-02 15:53:59.808205400 +0200
+++ b/editor/pnmpad.c 2021-06-02 20:23:21.829634431 +0200
@@ -654,6 +654,8 @@ main(int argc, const char ** argv) { @@ -654,6 +654,8 @@ main(int argc, const char ** argv) {
computePadSizes(cmdline, cols, rows, &lpad, &rpad, &tpad, &bpad); computePadSizes(cmdline, cols, rows, &lpad, &rpad, &tpad, &bpad);
@ -2829,10 +2827,54 @@ diff -ruNp a/other/pnmcolormap.c b/other/pnmcolormap.c
} }
{ {
unsigned int const intQuotient = colormap.size / pamP->width; unsigned int const intQuotient = colormap.size / pamP->width;
diff -ruNp a/urt/rle_addhist.c b/urt/rle_addhist.c diff --git a/urt/Runput.c b/urt/Runput.c
--- a/urt/rle_addhist.c 2021-06-02 15:53:59.825205563 +0200 index 1a7f2f7..de2737b 100644
+++ b/urt/rle_addhist.c 2021-06-02 20:23:21.834634475 +0200 --- a/urt/Runput.c
@@ -70,13 +70,18 @@ rle_addhist(char * argv[], +++ b/urt/Runput.c
@@ -202,6 +202,7 @@ RunSetup(rle_hdr * the_hdr)
if ( the_hdr->background != 0 )
{
int i;
+ overflow_add(the_hdr->ncolors, 1);
rle_pixel *background =
(rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) );
int *bg_color;
@@ -224,7 +225,7 @@ RunSetup(rle_hdr * the_hdr)
/* Big-endian machines are harder */
int i, nmap = (1 << the_hdr->cmaplen) *
the_hdr->ncmap;
- char *h_cmap = (char *)malloc( nmap * 2 );
+ char *h_cmap = (char *)malloc2( nmap, 2 );
if ( h_cmap == NULL )
{
fprintf( stderr,
diff --git a/urt/rle.h b/urt/rle.h
index 1e7ddd0..df45dd9 100644
--- a/urt/rle.h
+++ b/urt/rle.h
@@ -152,6 +152,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 45c3dbf..ef13973 100644
--- a/urt/rle_addhist.c
+++ b/urt/rle_addhist.c
@@ -70,13 +70,19 @@ rle_addhist(char * argv[],
return; return;
length = 0; length = 0;
@ -2846,14 +2888,14 @@ diff -ruNp a/urt/rle_addhist.c b/urt/rle_addhist.c
time(&temp); time(&temp);
timedate = ctime(&temp); timedate = ctime(&temp);
length += strlen(timedate); /* length of date and time in ASCII. */ length += strlen(timedate); /* length of date and time in ASCII. */
-
+ overflow_add(strlen(padding), 4); + overflow_add(strlen(padding), 4);
+ overflow_add(strlen(histoire), strlen(padding) + 4); + overflow_add(strlen(histoire), strlen(padding) + 4);
+ overflow_add(length, strlen(histoire) + strlen(padding) + 4); + overflow_add(length, strlen(histoire) + strlen(padding) + 4);
length += strlen(padding) + 3 + strlen(histoire) + 1; length += strlen(padding) + 3 + strlen(histoire) + 1;
/* length of padding, "on " and length of history name plus "="*/ /* length of padding, "on " and length of history name plus "="*/
if (in_hdr) /* if we are interested in the old comments... */ if (in_hdr) /* if we are interested in the old comments... */
@@ -84,8 +89,10 @@ rle_addhist(char * argv[], @@ -84,8 +90,10 @@ rle_addhist(char * argv[],
else else
old = NULL; old = NULL;
@ -2865,9 +2907,10 @@ diff -ruNp a/urt/rle_addhist.c b/urt/rle_addhist.c
++length; /*Cater for the null. */ ++length; /*Cater for the null. */
diff -ruNp a/urt/rle_getrow.c b/urt/rle_getrow.c diff --git a/urt/rle_getrow.c b/urt/rle_getrow.c
--- a/urt/rle_getrow.c 2021-06-02 15:53:59.825205563 +0200 index a24870a..0ba62c3 100644
+++ b/urt/rle_getrow.c 2021-06-02 20:23:21.834634475 +0200 --- a/urt/rle_getrow.c
+++ b/urt/rle_getrow.c
@@ -164,6 +164,7 @@ rle_get_setup(rle_hdr * const the_hdr) { @@ -164,6 +164,7 @@ rle_get_setup(rle_hdr * const the_hdr) {
char * cp; char * cp;
@ -2876,30 +2919,10 @@ diff -ruNp a/urt/rle_getrow.c b/urt/rle_getrow.c
evenlen = (comlen + 1) & ~1; /* make it even */ evenlen = (comlen + 1) & ~1; /* make it even */
if (evenlen) { if (evenlen) {
MALLOCARRAY(comment_buf, evenlen); MALLOCARRAY(comment_buf, evenlen);
diff -ruNp a/urt/rle.h b/urt/rle.h diff --git a/urt/rle_hdr.c b/urt/rle_hdr.c
--- a/urt/rle.h 2021-06-02 15:53:59.825205563 +0200 index 8ceaa9e..4c13037 100644
+++ b/urt/rle.h 2021-06-02 20:23:21.834634475 +0200 --- a/urt/rle_hdr.c
@@ -153,6 +153,17 @@ rle_hdr /* End of typedef. * +++ b/urt/rle_hdr.c
*/
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 -ruNp a/urt/rle_hdr.c b/urt/rle_hdr.c
--- a/urt/rle_hdr.c 2021-06-02 15:53:59.825205563 +0200
+++ b/urt/rle_hdr.c 2021-06-02 20:23:21.835634483 +0200
@@ -148,7 +148,7 @@ rle_hdr_cp(rle_hdr * const fromHdrP, @@ -148,7 +148,7 @@ rle_hdr_cp(rle_hdr * const fromHdrP,
if (toHdrP->cmap) { if (toHdrP->cmap) {
size_t const size = size_t const size =
@ -2945,72 +2968,3 @@ diff -ruNp a/urt/rle_putcom.c b/urt/rle_putcom.c
/* Not found */ /* Not found */
/* Can't realloc because somebody else might be pointing to this /* Can't realloc because somebody else might be pointing to this
* comments block. Of course, if this were true, then the * comments block. Of course, if this were true, then the
diff -ruNp a/urt/Runput.c b/urt/Runput.c
--- a/urt/Runput.c 2021-06-02 15:53:59.825205563 +0200
+++ b/urt/Runput.c 2021-06-02 20:23:21.834634475 +0200
@@ -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 -ruNp a/urt/scanargs.c b/urt/scanargs.c
--- a/urt/scanargs.c 2021-06-02 15:53:59.825205563 +0200
+++ b/urt/scanargs.c 2021-06-02 20:56:36.681068294 +0200
@@ -62,8 +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 );
@@ -114,7 +114,7 @@ va_list argl;
bool required;
int excnt; /* which flag is set */
- unsigned int exflag; /* How many of a set of exclusive
+ bool exflag; /* when set, one of a set of exclusive
flags is set */
bool list_of; /* set if parsing off a list of args */
@@ -258,7 +258,7 @@ reswitch:
/* go back to label */
ncp = cp-1; /* remember */
cp -= 3;
- for (excnt = exflag = 0
+ for (excnt = 0, exflag = NO
; *cp != ' ' && !(*cp=='-' &&(cp[-1]=='!'||cp[-1]=='%'));
(--cp, excnt++))
{
@@ -273,7 +273,7 @@ reswitch:
ERROR ("extra flags ignored");
if (exflag)
ERROR ("more than one exclusive flag chosen");
- exflag++;
+ exflag = YES;
required = NO;
check += cnt;
arg_used[cnt] = 1;

@ -1,267 +1,119 @@
diff --git a/editor/ppmfade b/editor/ppmfade diff -urNp a/editor/ppmfade b/editor/ppmfade
index dcd7bf2..5091651 100755 --- a/editor/ppmfade 2022-06-28 07:58:59.195317750 +0200
--- a/editor/ppmfade +++ b/editor/ppmfade 2022-06-28 08:04:56.070643056 +0200
+++ b/editor/ppmfade @@ -215,84 +215,84 @@ for ($i = 1; $i <= $nframes; $i++) {
@@ -40,6 +40,7 @@ exec perl -w -x -S -- "$0" "$@"
#
##############################################################################
use strict;
+use File::Temp "tempdir";
sub doVersionHack($) {
my ($argvR) = @_;
@@ -149,20 +150,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 +177,14 @@ if ($last_file eq "undefined") {
#
# Here's what our temporary files are:
-# junk1$$.ppm: The original (fade-from) image
-# junk2$$.ppm: The target (fade-from) image
-# junk3$$.ppm: The frame of the fade for the current iteration of the
-# the for loop.
-# junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate
-# image to another, this is the first frame of that
-# sequence.
-# junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence
+# $tmpdir/junk1$$.ppm: The original (fade-from) image
+# $tmpdir/junk2$$.ppm: The target (fade-from) image
+# $tmpdir/junk3$$.ppm: The frame of the fade for the current iteration of the
+# the for loop.
+# $tmpdir/junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate
+# image to another, this is the first frame of that
+# sequence.
+# $tmpdir/junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence
my $i; # Frame number
for ($i = 1; $i <= $nframes; $i++) {
@@ -185,147 +192,147 @@ for ($i = 1; $i <= $nframes; $i++) {
if ($mode eq $SPREAD) {
if ($i <= 10) {
my $n = $spline20[$i] * 100;
- system("ppmspread $n junk1$$.ppm >junk3$$.ppm");
+ system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm");
} elsif ($i <= 20) {
my $n;
$n = $spline20[$i] * 100; $n = $spline20[$i] * 100;
- system("ppmspread $n junk1$$.ppm >junk1a$$.ppm"); system("ppmshift $n $tmpdir/junk1.ppm >$tmpdir/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; $n = (1-$spline20[$i-10])*100;
- system("ppmshift $n junk2$$.ppm >junk2a$$.ppm"); - system("ppmshift $n junk2.ppm >junk2a.ppm");
+ system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm"); + system("ppmshift $n $tmpdir/junk2.ppm >$tmpdir/junk2a.ppm");
$n = $spline10[$i-10]; $n = $spline10[$i-10];
- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk1a.ppm junk2a.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk1a.ppm $tmpdir/junk2a.ppm >$tmpdir/junk3.ppm");
} else { } else {
my $n = (1-$spline20[$i-10]) * 100; my $n = (1-$spline20[$i-10]) * 100;
- system("ppmshift $n junk2$$.ppm >junk3$$.ppm"); - system("ppmshift $n junk2.ppm >junk3.ppm");
+ system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmshift $n $tmpdir/junk2.ppm >$tmpdir/junk3.ppm");
} }
} elsif ($mode eq $RELIEF) { } elsif ($mode eq $RELIEF) {
if ($i == 1) { if ($i == 1) {
- system("ppmrelief junk1$$.ppm >junk1r$$.ppm"); - system("ppmrelief junk1.ppm >junk1r.ppm");
+ system("ppmrelief $tmpdir/junk1$$.ppm >$tmpdir/junk1r$$.ppm"); + system("ppmrelief $tmpdir/junk1.ppm >$tmpdir/junk1r.ppm");
} }
if ($i <= 10) { if ($i <= 10) {
my $n = $spline10[$i]; my $n = $spline10[$i];
- system("ppmmix $n junk1$$.ppm junk1r$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk1.ppm junk1r.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1r$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk1.ppm $tmpdir/junk1r.ppm >$tmpdir/junk3.ppm");
} elsif ($i <= 20) { } elsif ($i <= 20) {
my $n = $spline10[$i-10]; my $n = $spline10[$i-10];
- system("ppmmix $n junk1r$$.ppm junk2r$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk1r.ppm junk2r.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk1r$$.ppm $tmpdir/junk2r$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk1r.ppm $tmpdir/junk2r.ppm >$tmpdir/junk3.ppm");
} else { } else {
my $n = $spline10[$i-20]; my $n = $spline10[$i-20];
- system("ppmmix $n junk2r$$.ppm junk2$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk2r.ppm junk2.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk2r$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk2r.ppm $tmpdir/junk2.ppm >$tmpdir/junk3.ppm");
} }
if ($i == 10) { if ($i == 10) {
- system("ppmrelief junk2$$.ppm >junk2r$$.ppm"); - system("ppmrelief junk2.ppm >junk2r.ppm");
+ system("ppmrelief $tmpdir/junk2$$.ppm >$tmpdir/junk2r$$.ppm"); + system("ppmrelief $tmpdir/junk2.ppm >$tmpdir/junk2r.ppm");
} }
} elsif ($mode eq $OIL) { } elsif ($mode eq $OIL) {
if ($i == 1) { if ($i == 1) {
- system("ppmtopgm junk1$$.ppm | pgmoil >junko$$.ppm"); - system("ppmtopgm junk1.ppm | pgmoil >junko.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . - system("rgb3toppm junko.ppm junko.ppm junko.ppm " .
- ">junk1o$$.ppm"); - ">junk1o.ppm");
+ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmoil >$tmpdir/junko$$.ppm"); + system("ppmtopgm $tmpdir/junk1.ppm | pgmoil >$tmpdir/junko.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . + system("rgb3toppm $tmpdir/junko.ppm $tmpdir/junko.ppm $tmpdir/junko.ppm " .
+ ">$tmpdir/junk1o$$.ppm"); + ">$tmpdir/junk1o.ppm");
} }
if ($i <= 10) { if ($i <= 10) {
my $n = $spline10[$i]; my $n = $spline10[$i];
- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk1.ppm junk1o.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk1.ppm $tmpdir/junk1o.ppm >$tmpdir/junk3.ppm");
} elsif ($i <= 20) { } elsif ($i <= 20) {
my $n = $spline10[$i-10]; my $n = $spline10[$i-10];
- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk1o.ppm junk2o.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk1o.ppm $tmpdir/junk2o.ppm >$tmpdir/junk3.ppm");
} else { } else {
my $n = $spline10[$i-20]; my $n = $spline10[$i-20];
- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk2o.ppm junk2.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk2o.ppm $tmpdir/junk2.ppm >$tmpdir/junk3.ppm");
} }
if ($i == 10) { if ($i == 10) {
- system("ppmtopgm junk2$$.ppm | pgmoil >junko$$.ppm"); - system("ppmtopgm junk2.ppm | pgmoil >junko.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . - system("rgb3toppm junko.ppm junko.ppm junko.ppm " .
- ">junk2o$$.ppm"); - ">junk2o.ppm");
+ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmoil >$tmpdir/junko$$.ppm"); + system("ppmtopgm $tmpdir/junk2.ppm | pgmoil >$tmpdir/junko.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . + system("rgb3toppm $tmpdir/junko.ppm $tmpdir/junko.ppm $tmpdir/junko.ppm " .
+ ">$tmpdir/junk2o$$.ppm"); + ">$tmpdir/junk2o.ppm");
} }
} elsif ($mode eq $EDGE) { } elsif ($mode eq $EDGE) {
if ($i == 1) { if ($i == 1) {
- system("ppmtopgm junk1$$.ppm | pgmedge >junko$$.ppm"); - system("ppmtopgm junk1.ppm | pgmedge >junko.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . - system("rgb3toppm junko.ppm junko.ppm junko.ppm " .
- ">junk1o$$.ppm"); - ">junk1o.ppm");
+ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmedge >$tmpdir/junko$$.ppm"); + system("ppmtopgm $tmpdir/junk1.ppm | pgmedge >$tmpdir/junko.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . + system("rgb3toppm $tmpdir/junko.ppm $tmpdir/junko.ppm $tmpdir/junko.ppm " .
+ ">$tmpdir/junk1o$$.ppm"); + ">$tmpdir/junk1o.ppm");
} }
if ($i <= 10) { if ($i <= 10) {
my $n = $spline10[$i]; my $n = $spline10[$i];
- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk1.ppm junk1o.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk1.ppm $tmpdir/junk1o.ppm >$tmpdir/junk3.ppm");
} elsif ($i <= 20) { } elsif ($i <= 20) {
my $n = $spline10[$i-10]; my $n = $spline10[$i-10];
- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk1o.ppm junk2o.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk1o.ppm $tmpdir/junk2o.ppm >$tmpdir/junk3.ppm");
} else { } else {
my $n = $spline10[$i-20]; my $n = $spline10[$i-20];
- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk2o.ppm junk2.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk2o.ppm $tmpdir/junk2.ppm >$tmpdir/junk3.ppm");
} }
if ($i == 10) { if ($i == 10) {
- system("ppmtopgm junk2$$.ppm | pgmedge >junko$$.ppm"); - system("ppmtopgm junk2.ppm | pgmedge >junko.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . - system("rgb3toppm junko.ppm junko.ppm junko.ppm " .
- ">junk2o$$.ppm"); - ">junk2o.ppm");
+ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmedge >$tmpdir/junko$$.ppm"); + system("ppmtopgm $tmpdir/junk2.ppm | pgmedge >$tmpdir/junko.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . + system("rgb3toppm $tmpdir/junko.ppm $tmpdir/junko.ppm $tmpdir/junko.ppm " .
+ ">$tmpdir/junk2o$$.ppm"); + ">$tmpdir/junk2o.ppm");
} }
} elsif ($mode eq $BENTLEY) { } elsif ($mode eq $BENTLEY) {
if ($i == 1) { if ($i == 1) {
- system("ppmtopgm junk1$$.ppm | pgmbentley >junko$$.ppm"); - system("ppmtopgm junk1.ppm | pgmbentley >junko.ppm");
- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " . - system("rgb3toppm junko.ppm junko.ppm junko.ppm " .
- ">junk1o$$.ppm"); - ">junk1o.ppm");
+ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmbentley >$tmpdir/junko$$.ppm"); + system("ppmtopgm $tmpdir/junk1.ppm | pgmbentley >$tmpdir/junko.ppm");
+ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " . + system("rgb3toppm $tmpdir/junko.ppm $tmpdir/junko.ppm $tmpdir/junko.ppm " .
+ ">$tmpdir/junk1o$$.ppm"); + ">$tmpdir/junk1o.ppm");
} }
if ($i <= 10) { if ($i <= 10) {
my $n = $spline10[$i]; my $n = $spline10[$i];
- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk1.ppm junk1o.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk1.ppm $tmpdir/junk1o.ppm >$tmpdir/junk3.ppm");
} elsif ($i <= 20) { } elsif ($i <= 20) {
my $n = $spline10[$i-10]; my $n = $spline10[$i-10];
- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm"); - system("ppmmix $n junk1o.ppm junk2o.ppm >junk3.ppm");
+ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm"); + system("ppmmix $n $tmpdir/junk1o.ppm $tmpdir/junk2o.ppm >$tmpdir/junk3.ppm");
} else { } else {
my $n = $spline10[$i-20]; my $n = $spline10[$i-20];
- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm"); system("ppmmix $n $tmpdir/junk2o.ppm $tmpdir/junk2.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);

@ -1,19 +0,0 @@
diff -urNp a/converter/ppm/winicontoppm.c b/converter/ppm/winicontoppm.c
--- a/converter/ppm/winicontoppm.c 2021-08-16 15:01:10.340119568 +0200
+++ b/converter/ppm/winicontoppm.c 2021-08-16 15:02:02.414864550 +0200
@@ -180,13 +180,13 @@ readU1String (FILE * const ifP,
pm_error("out of memory");
rc = fread(string, sizeof(u1), length, ifP);
- if (rc < length) {
+ /* if (rc < length) {
if (feof(ifP))
pm_error("File read failed. Premature end of file");
else
pm_error("File read failed. Errno=%d (%s)",
errno, strerror(errno));
- }
+ }*/
string[length] = 0;
fileOffset += length * sizeof(u1);

@ -1,7 +1,7 @@
Summary: A library for handling different graphics file formats Summary: A library for handling different graphics file formats
Name: netpbm Name: netpbm
Version: 10.95.00 Version: 11.02.00
Release: 2%{?dist} Release: 8%{?dist}
# See copyright_summary for details # See copyright_summary for details
License: BSD and GPLv2 and IJG and MIT and Public Domain License: BSD and GPLv2 and IJG and MIT and Public Domain
URL: http://netpbm.sourceforge.net/ URL: http://netpbm.sourceforge.net/
@ -24,12 +24,12 @@ Patch9: netpbm-xwdfix.patch
Patch10: netpbm-multilib.patch Patch10: netpbm-multilib.patch
Patch11: netpbm-glibc.patch Patch11: netpbm-glibc.patch
Patch12: netpbm-docfix.patch Patch12: netpbm-docfix.patch
Patch13: netpbm-cmuwtopbm.patch
Patch14: netpbm-pamtojpeg2k.patch Patch14: netpbm-pamtojpeg2k.patch
Patch15: netpbm-manfix.patch Patch15: netpbm-manfix.patch
Patch16: netpbm-jasper.patch Patch16: netpbm-jasper.patch
Patch17: netpbm-libdir-so.patch Patch17: netpbm-libdir-so.patch
Patch18: netpbm-test.patch Patch18: netpbm-c99.patch
Patch19: netpbm-c99-2.patch
BuildRequires: make BuildRequires: make
BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, flex, gcc, jbigkit-devel BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, flex, gcc, jbigkit-devel
@ -93,6 +93,7 @@ rm -rf converter/other/jpeg2000/libjasper/
rm -rf converter/other/jbig/libjbig/ rm -rf converter/other/jbig/libjbig/
%build %build
%set_build_flags
./configure <<EOF ./configure <<EOF
@ -119,19 +120,19 @@ TOP=`pwd`
make \ make \
CC="%{__cc}" \ CC="%{__cc}" \
LDFLAGS="$RPM_LD_FLAGS -L$TOP/pbm -L$TOP/pgm -L$TOP/pnm -L$TOP/ppm" \ LDFLAGS="$LD_FLAGS -L$TOP/pbm -L$TOP/pgm -L$TOP/pnm -L$TOP/ppm" \
CFLAGS="$RPM_OPT_FLAGS -fPIC -flax-vector-conversions -fno-strict-aliasing" \ CFLAGS="$CFLAGS -fPIC -flax-vector-conversions -fno-strict-aliasing" \
CFLAGS_CONFIG="$RPM_OPT_FLAGS" \ CFLAGS_CONFIG="$CFLAGS" \
LADD="-lm -Wl,-z,now" \ LADD="-lm" \
JPEGINC_DIR=%{_includedir} \ JPEGINC_DIR=%{_usr}/include \
PNGINC_DIR=%{_includedir} \ PNGINC_DIR=%{_usr}/include \
TIFFINC_DIR=%{_includedir} \ TIFFINC_DIR=%{_usr}/include \
JPEGLIB_DIR=%{_libdir} \ JPEGLIB_DIR=%{_usr}/%{_lib} \
JBIGLIB=%{_libdir}/libjbig.so.2.1 \ JBIGLIB=%{_usr}/%{_lib}/libjbig.so.2.1 \
PNGLIB_DIR=%{_libdir} \ PNGLIB_DIR=%{_usr}/%{_lib} \
TIFFLIB_DIR=%{_libdir} \ TIFFLIB_DIR=%{_usr}/%{_lib} \
LINUXSVGALIB="NONE" \ LINUXSVGALIB="NONE" \
X11LIB=%{_libdir}/libX11.so \ X11LIB=%{_usr}/%{_lib}/libX11.so \
XML2LIBS="NONE" XML2LIBS="NONE"
# prepare man files # prepare man files
@ -149,12 +150,12 @@ done
%install %install
make package pkgdir=%{buildroot}/usr LINUXSVGALIB="NONE" XML2LIBS="NONE" make package pkgdir=%{buildroot}%{_prefix} LINUXSVGALIB="NONE" XML2LIBS="NONE"
# Ugly hack to have libs in correct dir on 64bit archs. # Ugly hack to have libs in correct dir on 64bit archs.
mkdir -p %{buildroot}%{_libdir} mkdir -p %{buildroot}%{_libdir}
if [ "%{_libdir}" != "/usr/lib" ]; then if [ "%{_lib}" != "lib" ]; then
mv %{buildroot}/usr/lib/lib* %{buildroot}%{_libdir} mv %{buildroot}%{_prefix}/lib/lib* %{buildroot}%{_libdir}
fi fi
cp -af lib/libnetpbm.a %{buildroot}%{_libdir}/libnetpbm.a cp -af lib/libnetpbm.a %{buildroot}%{_libdir}/libnetpbm.a
@ -176,16 +177,16 @@ done
rm -f %{buildroot}%{_mandir}/man5/extendedopacity.5 rm -f %{buildroot}%{_mandir}/man5/extendedopacity.5
mkdir -p %{buildroot}%{_datadir}/netpbm mkdir -p %{buildroot}%{_datadir}/netpbm
mv %{buildroot}/usr/misc/*.map %{buildroot}%{_datadir}/netpbm/ mv %{buildroot}%{_prefix}/misc/*.map %{buildroot}%{_datadir}/netpbm/
mv %{buildroot}/usr/misc/rgb.txt %{buildroot}%{_datadir}/netpbm/ mv %{buildroot}%{_prefix}/misc/rgb.txt %{buildroot}%{_datadir}/netpbm/
rm -rf %{buildroot}/usr/README rm -rf %{buildroot}%{_prefix}/README
rm -rf %{buildroot}/usr/VERSION rm -rf %{buildroot}%{_prefix}/VERSION
rm -rf %{buildroot}/usr/link rm -rf %{buildroot}%{_prefix}/link
rm -rf %{buildroot}/usr/misc rm -rf %{buildroot}%{_prefix}/misc
rm -rf %{buildroot}/usr/man rm -rf %{buildroot}%{_prefix}/man
rm -rf %{buildroot}/usr/pkginfo rm -rf %{buildroot}%{_prefix}/pkginfo
rm -rf %{buildroot}/usr/config_template rm -rf %{buildroot}%{_prefix}/config_template
rm -rf %{buildroot}/usr/pkgconfig_template rm -rf %{buildroot}%{_prefix}/pkgconfig_template
# Don't ship the static library # Don't ship the static library
rm -f %{buildroot}%{_libdir}/lib*.a rm -f %{buildroot}%{_libdir}/lib*.a
@ -229,21 +230,77 @@ popd
%doc userguide/* %doc userguide/*
%changelog %changelog
* Tue Aug 17 2021 Josef Ridky <jridky@redhat.com> - 10.95.00-2 * Tue Nov 26 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 11.02.00-8
- add gating.yaml file - Rebuilt for MSVSphere 10
* Mon Aug 16 2021 Josef Ridky <jridky@redhat.com> - 10.95.00-1 * Wed Jun 26 2024 Josef Ridky <jridky@redhat.com> - 11.02.00-8
- update to 10.95.00 and disable winicon checks (#1994047) - Add gating.yaml file
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 10.94.05-3 * Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 11.02.00-7
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Bump release for June 2024 mass rebuild
Related: rhbz#1991688
* Thu Jun 03 2021 Josef Ridky <jridky@redhat.com> - 10.94.05-2 * Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 11.02.00-6
- Fix library linking issue - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jun 03 2021 Josef Ridky <jridky@redhat.com> - 10.94.05-1 * Sun Jan 21 2024 Florian Weimer <fweimer@redhat.com> - 11.02.00-5
- Rebase to the new upstream release 10.94.05 (#1967407) - GCC 14 compatibility fixes:
Drop netpbm-cmuwtopbm.patch to fix an out-of-bounds stack write (#2259450)
Stub out unused converter/other/jpeg2000/libjasper_compat.c (#2259448)
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 11.02.00-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Nov 28 2023 Orion Poplawski <orion@nwra.com> - 11.02.00-3
- Rebuild for jasper 4.1
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 11.02.00-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Mon Mar 27 2023 Josef Ridky <jridky@redhat.com> - 11.02.00-1
- New upstream release 11.02.00 (#2157125)
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 11.01.00-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Jan 02 2023 Josef Ridky <jridky@redhat.com> - 11.01.00-1
- New upstream release 11.01.00 (#2157125)
* Fri Dec 02 2022 Florian Weimer <fweimer@redhat.com> - 11.00.00-2
- Port downstream-specific patches to C99
* Tue Oct 04 2022 Josef Ridky <jridky@redhat.com> - 11.00.00-1
- New upstream release 11.00.00 (#2130384)
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 10.99.00-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jun 28 2022 Josef Ridky <jridky@redhat.com> - 10.99.00-1
- New upstream release 10.99.00 (#2068865)
- Use %%set_build_flags to set environment variables
* Sun Feb 13 2022 Josef Ridky <jridky@redhat.com> - 10.97.00-4
- Bump spec for new jasper
* Fri Feb 11 2022 Josef Ridky <jridky@redhat.com> - 10.97.00-3
- Rebuild for new jasper
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 10.97.00-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Jan 03 2022 Josef Ridky <jridky@redhat.com> - 10.97.00-1
- New upstream release 10.97.00 (#2035806)
* Mon Oct 04 2021 Josef Ridky <jridky@redhat.com> - 10.96.00-1
- New upstream release 10.96.00 (#2007871)
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 10.95.00-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jul 15 2021 Josef Ridky <jridky@redhat.com> - 10.95.00-1
- New upstream release 10.95.00 (#1977974)
* Wed Mar 31 2021 Josef Ridky <jridky@redhat.com> - 10.94.05-1
- New upstream release 10.94.05 (#1943837)
* Mon Jan 25 2021 Josef Ridky <jridky@redhat.com> - 10.93.00-1 * Mon Jan 25 2021 Josef Ridky <jridky@redhat.com> - 10.93.00-1
- New upstream release 10.93.00 (#1911159) - New upstream release 10.93.00 (#1911159)

Loading…
Cancel
Save