about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--converter/pbm/g3topbm.c13
-rw-r--r--doc/HISTORY2
2 files changed, 8 insertions, 7 deletions
diff --git a/converter/pbm/g3topbm.c b/converter/pbm/g3topbm.c
index 5d98fcb2..02641eb5 100644
--- a/converter/pbm/g3topbm.c
+++ b/converter/pbm/g3topbm.c
@@ -527,7 +527,7 @@ readFaxRow(struct BitStream * const bitStreamP,
     done = FALSE;
 
     while (!done) {
-        if (col >= MAXCOLS) {
+        if (col > MAXCOLS) {
             pm_asprintf(exceptionP, "Line is too long for this program to "
                         "handle -- longer than %u columns", MAXCOLS);
             done = TRUE;
@@ -552,12 +552,11 @@ readFaxRow(struct BitStream * const bitStreamP,
                 curcode = (curcode << 1) | bit;
                 ++curlen;
 
-		if (curlen > 11 && curcode == 0x00) {
-		    if (++fillbits > MAXFILLBITS)
-                pm_error("Encountered %u consecutive fill bits.  "
-                       "Aborting", fillbits);
-		}
-		else if (curlen - fillbits > 13) {
+                if (curlen > 11 && curcode == 0x00) {
+                    if (++fillbits > MAXFILLBITS)
+                        pm_error("Encountered %u consecutive fill bits.  "
+                                 "Aborting", fillbits);
+                } else if (curlen - fillbits > 13) {
                     formatBadCodeException(exceptionP, col, curlen, curcode);
                     done = TRUE;
                 } else if (curcode != 0) {
diff --git a/doc/HISTORY b/doc/HISTORY
index bbd399b7..75f6819f 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -10,6 +10,8 @@ not yet  BJH  Release 10.97.00
 
               pampaintspill: Add -near.  Thanks Scott Pakin.
 
+              g3topbm: Fix bug: arbitrary behavior with very wide image.
+
               pamtogif: Fix bug: doesn't ignore the input alpha mask when user
               specified -transparent.  Broken in Netpbm 10.37 (December 2006).