about summary refs log tree commit diff
path: root/converter
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-04-07 21:00:13 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-04-07 21:00:13 +0000
commit4bdcfe061dd5e3d6e6323abfabd0526742876b14 (patch)
tree34220ca46a2a6d25059c65f0a71e674f8987994c /converter
parent22b7160c8fd79609d315e34def8a0573ba04eb21 (diff)
downloadnetpbm-mirror-4bdcfe061dd5e3d6e6323abfabd0526742876b14.tar.gz
netpbm-mirror-4bdcfe061dd5e3d6e6323abfabd0526742876b14.tar.xz
netpbm-mirror-4bdcfe061dd5e3d6e6323abfabd0526742876b14.zip
Release 10.35.26
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@274 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r--converter/ppm/picttoppm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/converter/ppm/picttoppm.c b/converter/ppm/picttoppm.c
index cfc5760e..e31d5169 100644
--- a/converter/ppm/picttoppm.c
+++ b/converter/ppm/picttoppm.c
@@ -1574,6 +1574,8 @@ allocPlanes(struct rgbPlanes * const planesP) {
     memset(planes.grn, 255, planelen * sizeof(word));
     memset(planes.blu, 255, planelen * sizeof(word));
 
+    *planesP = planes;
+
     /* Until we wean this program off of global variables, we have to
        set these:
     */
@@ -2170,15 +2172,11 @@ copyPixelGroup(unsigned char * const block,
         unpackBuf(&block[1], groupLen * pkpixsize, bitsPerPixel,
                   &bytePixels, &bytePixelLen);
         
-        if (bytePixelLen > destSize)
-            pm_error("Invalid PICT image.  It contains a row with more pixels "
-                     "than the width of the image");
-        
-        for (i = 0; i < bytePixelLen; ++i)
+        for (i = 0; i < MIN(bytePixelLen, destSize); ++i)
             dest[i] = bytePixels[i];
         
         *blockLengthP = blockLength;
-        *rasterBytesGeneratedP = bytePixelLen;
+        *rasterBytesGeneratedP = MIN(bytePixelLen, destSize);
     }
 }