New Ghostscript/GhostPDL compiler warnings - 2018-03-01-10:15:13 - 0221c9e4c43b25375dab6c9d15a777eecf20d261

[email protected] Thu, 1 Mar 2018 11:48:21 -0800 (PST)
Newsgroups gmane.comp.printing.ghostscript.regression
Message-ID <20180301194821.5BB43204064B@i7>
Previous Revision: e27f0530e3410547563daf757dc5c121c21d2f1c
 Current Revision: 0221c9e4c43b25375dab6c9d15a777eecf20d261

commit 0221c9e4c43b25375dab6c9d15a777eecf20d261
Author:     Ken Sharp <[email protected]>
AuthorDate: Thu Mar 1 18:13:13 2018 +0000
CommitDate: Thu Mar 1 18:13:13 2018 +0000

    Fix CCITT Fax Encoder
    
    Bug #696413 "Seg faults found by fuzzing in pdf_store_page_resources (gdevpdfu.c:1663)"
    
    As noted it eh bug report, the problem is that the encoding buffer is
    allocated with a size based on the maximum number of bits for horizontal
    encoding (6 bits per pixel), but for 2D encoding some of the bits might
    use vertical encoding. Vertically encoded bits with an offset of 3 use
    7 bits per pixel, not 6.
    
    If we get a line with sufficient 7-bit encodings, where the horizontal
    bits are encoded with 6 bits (eg runs of 1 pixel), then we can end up
    running off the end of the buffer. Make the allocation assume a maximum
    of 7 encoded bits per pixel instead.

base/scfe.c



Ghostscript:

new cppcheck warnings (Cppcheck 1.72): 

base/scfe.c:148: error: Shifting a negative value is undefined behaviour

http://miles.ghostscript.com:8080/artifex/0221c9e4c43b25375dab6c9d15a777eecf20d261/gs-cppcheck.txt