about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-12-04 17:05:56 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-12-04 17:05:56 +0000
commit6c91abbb532afb5186ab2307fb1ef0033f58b1f1 (patch)
treeb796d32c36ca563ce7ff6c9125c10c922c67250c
parente7699067fce588bb8ac3172f19783db2b3b87990 (diff)
downloadnetpbm-mirror-6c91abbb532afb5186ab2307fb1ef0033f58b1f1.tar.gz
netpbm-mirror-6c91abbb532afb5186ab2307fb1ef0033f58b1f1.tar.xz
netpbm-mirror-6c91abbb532afb5186ab2307fb1ef0033f58b1f1.zip
Release 10.47.42
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@1799 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--analyzer/pgmhist.c6
-rw-r--r--analyzer/pnmpsnr.c2
-rw-r--r--converter/other/pamtompfont.c2
-rw-r--r--converter/other/pamtotiff.c3
-rw-r--r--converter/pbm/xbmtopbm.c5
-rw-r--r--doc/HISTORY15
-rw-r--r--editor/pnmmontage.c27
-rw-r--r--other/pampick.c1
-rw-r--r--version.mk2
9 files changed, 49 insertions, 14 deletions
diff --git a/analyzer/pgmhist.c b/analyzer/pgmhist.c
index ede41e0d..4790ecba 100644
--- a/analyzer/pgmhist.c
+++ b/analyzer/pgmhist.c
@@ -40,9 +40,11 @@ parseCommandLine(int argc, const char ** argv,
     optEntry * option_def;
     unsigned int option_def_index;
     
-    MALLOCARRAY(option_def, 100);
+    MALLOCARRAY_NOFAIL(option_def, 100);
 
-    option_def_index = 0;   /* incremented by OPTENTRY */
+    option_def_index = 0;   /* incremented by OPTENT3 */
+
+    OPTENTINIT;
 
     opt.opt_table = option_def;
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */
diff --git a/analyzer/pnmpsnr.c b/analyzer/pnmpsnr.c
index c32f7d64..1160fff6 100644
--- a/analyzer/pnmpsnr.c
+++ b/analyzer/pnmpsnr.c
@@ -150,7 +150,7 @@ main (int argc, char **argv) {
     
     pnm_init(&argc, argv);
 
-    if (argc < 2) 
+    if (argc-1 < 2) 
         pm_error("Takes two arguments:  specifications of the two files.");
     else {
         filespec1 = argv[1];
diff --git a/converter/other/pamtompfont.c b/converter/other/pamtompfont.c
index f755dfef..ba170fef 100644
--- a/converter/other/pamtompfont.c
+++ b/converter/other/pamtompfont.c
@@ -53,6 +53,8 @@ parseCommandLine(int argc, char ** argv,
 
     option_def_index = 0;   /* incremented by OPTENTRY */
 
+    OPTENTINIT;
+
     opt.opt_table = option_def;
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */
     opt.allowNegNum = FALSE;  /* We have no parms that are negative numbers */
diff --git a/converter/other/pamtotiff.c b/converter/other/pamtotiff.c
index 9fac4b47..1b31c65b 100644
--- a/converter/other/pamtotiff.c
+++ b/converter/other/pamtotiff.c
@@ -126,9 +126,6 @@ validateTagList(struct optNameValue const taglist[]) {
             case TIFFTAG_ROWSPERSTRIP:
             case TIFFTAG_PLANARCONFIG:
             case TIFFTAG_COLORMAP:
-            case TIFFTAG_RESOLUTIONUNIT:
-            case TIFFTAG_XRESOLUTION:
-            case TIFFTAG_YRESOLUTION:
                 pm_error("You cannot specify a '%s' tag with -tag.  "
                          "Pamtotiff controls that internally or via other "
                          "options.", tagName);
diff --git a/converter/pbm/xbmtopbm.c b/converter/pbm/xbmtopbm.c
index 135b79f1..9505ba67 100644
--- a/converter/pbm/xbmtopbm.c
+++ b/converter/pbm/xbmtopbm.c
@@ -364,13 +364,14 @@ main(int    argc,
             bitrow[i] = bitreverse[*p++];
             
         if (cols % 8 > 0) {
-            bitrow[bytesPerRow] >>= 8 - cols % 8;
-            bitrow[bytesPerRow] <<= 8 - cols % 8;
+            bitrow[bytesPerRow-1] >>= 8 - cols % 8;
+            bitrow[bytesPerRow-1] <<= 8 - cols % 8;
         }
             
         pbm_writepbmrow_packed(stdout, bitrow, cols, 0);
     }
 
+    pbm_freerow(bitrow);
     free(data);
     pm_close(stdout);
 
diff --git a/doc/HISTORY b/doc/HISTORY
index 9b0301ec..5a3ac0ec 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,21 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+12.12.04 BJH  Release 10.47.42
+
+              pamtotiff: fix bug: XRESOLUTION, YRESOLUTION, and RESOLUTIONUNIT
+              not allowed in -tags.  Broken at least since 10.35.
+
+              pnmpsnr: fix crash when invoked (invalidly) with only one
+              argument.  Always broken.
+
+              pgmhist, pampick, pamtompfont: fix wild pointer in command line
+              parsing.  Bug has always been there in pampick, pamtompfont,
+              since 10.44 (September 2008) in pgmhist.
+
+              Xbmtopbm: fix incorrect output, memory leak.  Thanks Prophet of
+              the Way <afu@wta.att.ne.jp>.
+
 12.10.03 BJH  Release 10.47.41
 
               pamgauss: Fix bug: erroneously says -maxval is too big.
diff --git a/editor/pnmmontage.c b/editor/pnmmontage.c
index 4ccff497..2e30a43b 100644
--- a/editor/pnmmontage.c
+++ b/editor/pnmmontage.c
@@ -108,7 +108,7 @@ parseCommandLine(int argc, const char ** argv,
             pm_error("Filename '%s' contains a \":\", which is forbidden "
                      "with -data", argv[i+1]);
         else
-            cmdlineP->inFileName[i] = strdup(argv[1+1]);
+            cmdlineP->inFileName[i] = strdup(argv[i+1]);
     }
 }
 
@@ -366,6 +366,21 @@ adjustMaxval(tuple *            const tuplerow,
 
 
 static void
+makeRowBlack(struct pam * const pamP,
+             tuple *      const tuplerow) {
+
+    unsigned int col;
+
+    for (col = 0; col < pamP->width; ++col) {
+        unsigned int plane;
+        for (plane = 0; plane < pamP->depth; ++plane)
+            tuplerow[col][plane] = 0;
+    }
+}
+
+
+
+static void
 writePam(struct pam *       const outpamP,
          unsigned int       const nfiles,
          const coord *      const coords,
@@ -380,6 +395,9 @@ writePam(struct pam *       const outpamP,
 
     for (i = 0; i < outpamP->height; ++i) {
         int j;
+
+        makeRowBlack(outpamP, tuplerow);  /* initial value */
+
         for (j = 0; j < nfiles; ++j) {
             if (coords[j].y <= i && i < coords[j].y + imgs[j].height) {
                 pnm_readpamrow(&imgs[j], &tuplerow[coords[j].x]);
@@ -631,11 +649,10 @@ main(int argc, const char **argv) {
     pnm_setminallocationdepth(&outimg, outimg.depth);
 
     outimg.size = sizeof(outimg);
-    outimg.len = sizeof(outimg);
+    outimg.len = PAM_STRUCT_SIZE(allocation_depth);
+    pnm_setminallocationdepth(&outimg, outimg.depth);
+    outimg.plainformat = false;
     outimg.file = stdout;
-    outimg.bytes_per_sample = 0;
-    for (i = outimg.maxval; i; i >>= 8)
-        ++outimg.bytes_per_sample;
  
     writePam(&outimg, nfiles, coords, imgs);
 
diff --git a/other/pampick.c b/other/pampick.c
index c6b66fe1..63f32968 100644
--- a/other/pampick.c
+++ b/other/pampick.c
@@ -113,6 +113,7 @@ parseCommandLine(int argc, char ** argv,
        specifies an option.  But when we add an option in the future,
        it will go right here with an OPTENT3() macro invocation.
     */
+    OPTENTINIT;
 
     opt.opt_table = option_def;
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */
diff --git a/version.mk b/version.mk
index b7e191fb..02fe66bb 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 47
-NETPBM_POINT_RELEASE = 41
+NETPBM_POINT_RELEASE = 42