• Stephan Bergmann's avatar
    Fix -fsanitize=shift-exponent · 0733e658
    Stephan Bergmann yazdı
    ...as seen with `--convert-to pdf cdr/fdo55522-1.cdr` with cdr/fdo55522-1.cdr as
    obtained by bin/get-bugzilla-attachments-by-mimetype (i.e., the attachment at
    <https://bugs.documentfoundation.org/show_bug.cgi?id=55522#c0>):
    
    > vcl/source/fontsubset/cff.cxx:737:35: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'
    >  #0 in CffSubsetterContext::convertOneTypeOp() at vcl/source/fontsubset/cff.cxx:737:35 (instdir/program/libvcllo.so +0x9489ce3)
    >  #1 in CffSubsetterContext::convert2Type1Ops(CffLocal*, unsigned char const*, int, unsigned char*) at vcl/source/fontsubset/cff.cxx:1117:9 (instdir/program/libvcllo.so +0x94970d3)
    >  #2 in CffSubsetterContext::emitAsType1(Type1Emitter&, unsigned short const*, unsigned char const*, int*, int, FontSubsetInfo&) at vcl/source/fontsubset/cff.cxx:1969:28 (instdir/program/libvcllo.so +0x94a9ec8)
    [...]
    
    If any of these "overflow" bits of nHintMask should have been set by the
    preceding for loop, mbIgnoreHints would have been set and this for loop wouldn't
    be reached.
    
    Change-Id: I0fd6de10610b52300e081770e9df1078e7ee5f92
    Reviewed-on: https://gerrit.libreoffice.org/73247
    Tested-by: Jenkins
    Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
    0733e658
cff.cxx 73.9 KB