libXfont: Changes to 'master'

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Mon Oct 10 14:45:08 PDT 2011


 src/fontfile/decompress.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

New commits:
commit 8d130ac0fcf19e0e0dd0a404d9317fd8860baad4
Author: Tomas Hoger <thoger at redhat.com>
Date:   Mon Oct 10 14:38:06 2011 -0700

    Support compress files with maxbits < 12
    
    The compress decompression code used by libXfont rejects valid archives
    with maxbits less than 12 (compress allows values 9 - 16, 16 is the
    default).  This is because maxbits-12 is used as index to hsize_table[].
    
    That looks like an incorrect port of the original compress code, where:
    - hsize depended on BITS, the maximum maxbits value supported by particular
      build, rather than on maxbits value from the particular input file
    - the same hsize was used for all BITS <= 12
    
    The quick way to verify the problem is:
      compress -b 11 fontfile.bdf
      bdftopcf -o /dev/null fontfile.bdf.Z
    which fails, while 12-16 works correctly.
    
    This fix removes hsize_table and uses 1 << maxbits (aka maxmaxcode) as
    tab_prefix size.  As decompression code does not use hashing as compression
    code, there does not seem to be a reason to allocate any extra space.
    
    Note: In this fix, maxbits == 9 is still rejected early.  AFAICS compress
    is able to generate such files (unknown how correct such output is), but is
    unable to uncompress them correctly.
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>



More information about the xorg-commit mailing list