• This makes all integer type conversions that have potential data loss
    explicit with calls that do range checks and raise an exception. After
    this commit, qpdf builds with no warnings when -Wsign-conversion
    -Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
    with MSVC. This significantly reduces the likelihood of potential
    crashes from bogus integer values.
    
    There are some parts of the code that take int when they should take
    size_t or an offset. Such places would make qpdf not support files
    with more than 2^31 of something that usually wouldn't be so large. In
    the event that such a file shows up and is valid, at least qpdf would
    raise an error in the right spot so the issue could be legitimately
    addressed rather than failing in some weird way because of a silent
    overflow condition.
    Jay Berkenbilt authored
     
    Browse File »


  • On read, ignore /DecodeParms when empty list; on write, delete it.
    Some files have been found that include an empty list for
    /DecodeParms, but this is not technically compliant with the spec, and
    the only sensible interpretation is to treat it as if there are no
    decode parameters.
    Jay Berkenbilt authored
     
    Browse File »



















  • When requested, QPDFWriter will do more aggress prechecking of streams
    to make sure it can actually succeed in decoding them before
    attempting to do so. This will allow preservation of raw data even
    when the raw data is corrupted relative to the specified filters.
    Jay Berkenbilt authored
     
    Browse File »


  • For non-encrypted files, determinstic ID generation uses file contents
    instead of timestamp and file name. At a small runtime cost, this
    enables generation of the same /ID if the same inputs are converted in
    the same way multiple times.
    Jay Berkenbilt authored
     
    Browse File »

  • QPDFWriter was trying to make /Filter and /DecodeParms direct in all
    cases, but there are some cases where /DecodeParms may refer to a
    stream, which can't be direct. QPDFWriter doesn't actually need
    /DecodeParms to be direct in that case because it won't be able to
    filter the stream. Until we can handle this type of stream, just don't
    make /Filter and /DecodeParms direct if we can't filter the stream
    anyway.
    
    Fixes #34
    Jay Berkenbilt authored
     
    Browse File »