about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-02-18 16:22:39 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-02-18 16:22:39 +0000
commit88d2e514a14f4380d995fe4383a42e76e0461ab4 (patch)
tree0e45ff3d6e900b5d123e910a689fbe3e79ea7682
parent761b4a07ba0b16e8e111cb06bf30c4b9ae25f7e3 (diff)
downloadnetpbm-mirror-88d2e514a14f4380d995fe4383a42e76e0461ab4.tar.gz
netpbm-mirror-88d2e514a14f4380d995fe4383a42e76e0461ab4.tar.xz
netpbm-mirror-88d2e514a14f4380d995fe4383a42e76e0461ab4.zip
Release 10.35.80
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@1406 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--Makefile.version2
-rw-r--r--converter/pgm/asciitopgm.c19
-rw-r--r--doc/HISTORY9
-rw-r--r--generator/pamstereogram.c2
4 files changed, 29 insertions, 3 deletions
diff --git a/Makefile.version b/Makefile.version
index 62df8a7a..bb7893cb 100644
--- a/Makefile.version
+++ b/Makefile.version
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 35
-NETPBM_POINT_RELEASE = 79
+NETPBM_POINT_RELEASE = 80
diff --git a/converter/pgm/asciitopgm.c b/converter/pgm/asciitopgm.c
index b6b9c9a7..42f6e7db 100644
--- a/converter/pgm/asciitopgm.c
+++ b/converter/pgm/asciitopgm.c
@@ -55,6 +55,7 @@ main( argc, argv )
     bool warned;
     int *obuf;
     const char * const usage = "[-d <val>] height width [asciifile]";
+    char trunc;
 
     pgm_init( &argc, argv );
 
@@ -112,7 +113,7 @@ main( argc, argv )
         for (col = 0; col < cols; ++col) obuf[col] = 0;
     }
     grays = pgm_allocarray( cols, rows );
-    row = i = 0;
+    row = i = trunc = 0;
     while ( row < rows )
     {
         switch (c = getc (ifd))
@@ -120,6 +121,8 @@ main( argc, argv )
         case EOF:
             goto line_done;
         case '\n':
+	newline:
+	    trunc = 0;
             if ((c = getc (ifd)) == EOF)
                 goto line_done;
             if (c == '+')
@@ -137,11 +140,23 @@ main( argc, argv )
                 ++row;
                 if ( row >= rows )
                     break;
-                if (c != EOF)
+		if (c == '\n')
+		    goto newline;
+                else if (c != EOF)
                     obuf[i++] += gmap[c];
             }
             break;
         default:
+	    if (i == cols)
+	    {
+		if (! trunc)
+		{
+		    pm_message("Warning: row %d being truncated at %d columns",
+			       row+1, cols);
+		    trunc = 1;
+		}
+		continue;
+	    }
             if (c > 0x7f)       /* !isascii(c) */
             {
                 if (!warned)
diff --git a/doc/HISTORY b/doc/HISTORY
index 3f329b93..cb6b5ab2 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,15 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+11.02.18 BJH  Release 10.35.80
+
+              pamstereogram: fix crash when not doing texture.
+              Thanks Scott Pakin (scott@pakin.org).
+
+              asciitopgm: fix bug: memory corruption on too-long lines.
+
+              asciitopgm: fix bug: improper handling of blank lines.
+              
 11.01.15 BJH  Release 10.35.79
 
               configure: don't default to /usr/X11R6/lib/libX11.so just because
diff --git a/generator/pamstereogram.c b/generator/pamstereogram.c
index 0e6e6cc9..d7b46d7f 100644
--- a/generator/pamstereogram.c
+++ b/generator/pamstereogram.c
@@ -504,6 +504,8 @@ createoutputGenerator(struct cmdlineInfo const cmdline,
         /* Allow room for guides. */
     outGenP->pam.width  = inPamP->width;
 
+    outGenP->textureP = NULL;
+
     if (cmdline.patFilespec) {
         /* Background pixels should come from the pattern file. */