about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-01-28 20:27:16 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-01-28 20:27:16 +0000
commitfa53229528706ca8e5ae6f112732daedaf12a0f1 (patch)
tree5ca489a133e6e956639877ac830edf6a5187d90c
parentb2804921e6ccfd121da724730e53f0c9f7f8ce85 (diff)
downloadnetpbm-mirror-fa53229528706ca8e5ae6f112732daedaf12a0f1.tar.gz
netpbm-mirror-fa53229528706ca8e5ae6f112732daedaf12a0f1.tar.xz
netpbm-mirror-fa53229528706ca8e5ae6f112732daedaf12a0f1.zip
update HISTORY
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4840 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/ppm/ppmtowinicon.c6
-rw-r--r--doc/HISTORY3
2 files changed, 6 insertions, 3 deletions
diff --git a/converter/ppm/ppmtowinicon.c b/converter/ppm/ppmtowinicon.c
index e3c6a5c5..69baa2f6 100644
--- a/converter/ppm/ppmtowinicon.c
+++ b/converter/ppm/ppmtowinicon.c
@@ -402,9 +402,9 @@ newBitmap(unsigned int    const bpp,
           unsigned int    const rows,
           colorhash_table const cht) {
 
-    unsigned int const xByteCt = ROUNDUP(cols, 32)/8;
-       /* How wide the u1 string for each row should be -- Each byte is 8
-          pixels, but must be a multiple of 4 bytes.
+    unsigned int const xByteCt = ROUNDUP(cols * bpp, 32)/8;
+       /* How wide the u1 string for each row should be.  Pixels are packed
+          into bytes, padded to a multiple of 4 bytes.
        */
     ICON_bmp * icBitmapP;  /* malloc'ed */
     u1 ** rowData;  /* malloc'ed */
diff --git a/doc/HISTORY b/doc/HISTORY
index 4c1e786a..58c5e426 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -6,6 +6,9 @@ CHANGE HISTORY
 
 not yet  BJH  Release 11.06.00
 
+              ppmtowinicon: fix array overrun with 4 and 8 bits per pixel.
+              Broken in Netpbm 11.05 (December 2023).
+
               build: makeman: fix warning about backslashes in strings.
 
 23.12.28 BJH  Release 11.05.00