Age | Commit message (Collapse) | Author |
|
Exposed by weird-jpx.pdf from bug 696885.
|
|
|
|
|
|
|
|
|
|
New in PDF 2.0.
|
|
The stream loading is used only by the JS code loading.
|
|
|
|
|
|
Use a flag in the pdf_annot struct instead.
Don't pass pdf_document to annotation edit functions.
|
|
The implementation does not need to be in the public API.
|
|
The spec says entries should be 20 bytes long. In practise we
see 19 byte long ones more often than we like. This is due to
the use of a single EOL char rather than 2.
The PCLm files I've seen use 19 byte ones, so update the code
to cope with these.
|
|
Move the definition of fz_font to be in a private header file
rather than in the public API. Add accessors for specific
parts of the structure and use them as appropriate.
The font flags, and the harfbuzz records remain public.
This means that only 3 files now need access to the font
implementation (font.c, pdf-font.c and pdf-type3.c). This
may be able to be improved further in future.
|
|
|
|
|
|
Put them in the PDF name space and separate words with underscores.
Remove redundant namespace prefixes in java constants.
Device.FLAG_MASK rather than Device.FZ_DEVFLAG_MASK.
Use namespace for PDF annotation flag enum.
|
|
A PDF repair can be triggered 'just in time', when we encounter
a problem in the file. The idea is that this can happen without
the enclosing code being aware of it.
Thus the enclosing code may be holding 'borrowed' references
(such as those returned by pdf_dict_get()) at the time when the
repair is triggered. We are therefore at pains to ensure that
the repair does not replace any objects that exist already, so
that the calling code will not have these references unexpectedly
invalidated.
The sole exception to this is when we replace the 'Length' fields
in stream dictionaries with the actual lengths. Bug 697015 shows
exactly this situation causing a reference to become invalid.
The solution implemented here is to add an 'orphan list' to the
document, where we put these (hopefully few, small) objects. These
orphans are kept around until the document is closed.
|
|
A few commits back, we introduced the fz_key_storable concept
to allow us to cope with objects that were used both as values
within the store and as parts of keys within the store.
This commit worked, but showed up performance problems; when the
store has several million PDF objects in it, bulk changes (such
as dropping a display list or document) could trigger many passes
across the store.
We therefore introduce a mechanism to ameliorate this. These
passes, now known as "reap passes", can be batched together using
fz_defer_reap_start and fz_defer_reap_end.
We trigger this start/end around display list dropping, and around
PDF content stream processing. This should be fine, as deferral
will be interrupted if we ever run our of memory during mallocing.
|
|
|
|
We can use names as keys for colorspaces. These are not bound to
a particular document.
|
|
|
|
When we destroy a PDF document, currently we bin everything
from the store. Instead, drop just the objects that are
specifically tied to that document.
Any object tied to the document has a pdf_obj with the
required document pointer in it as the key.
|
|
We call Memento_addRef etc in fz_keep_impXX functions, so
don't call them in the callers too.
|
|
Getting a backtrace out with missing functions makes the
backtrace much less useful. Some backtrace routines (such
as that used by Memento on Android) are incapable of
resolving static functions.
We therefore provide 2 scripts (scripts/destatic.sh and
scripts/restatic.sh) that respectively remove and replace
the 'static' from function definitions.
The scripts do not affect "static inline" or "static const"
definitions, and they are are restricted to working in the
source directory (excluding source/tools), thirdparty/mujs
and the platform/{java,android} directories.
The transformed source should NOT be checked in.
To avoid problems with clashing symbols, some functions are
renamed or tweaked slightly in this patch.
|
|
|
|
Previously no fallbacks happened if the colorspace was not set, now gray
is assumed. The reason this is safe is that the softmasks backdrop color
entry is always filled with one component value (possibly being 0) matching
the gray component of the colorspace.
|
|
If there are no outlines, don't throw an error trying to
strip them.
|
|
Firstly, we avoid compressing streams if they get bigger.
Secondly, we ensure that we always update the Length field.
Seen as part of the investigation into bug 697092, though not the
actual cause. Thanks to Tor for the latter part of the fix.
|
|
In preference to colorspace internal to_rgb() function pointer.
|
|
We were only looking through the glyph name alias list for Type1 fonts.
Change the encodings for truetype to use the full glyph list alias list
as a fallback when the regular encoding by code point fails.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Only direct PDF name objects should be used as arguments,
indirect PDF name objects cannot be used.
|
|
|
|
This avoids resolving object references which is
important for dictionary keys.
|
|
|
|
|
|
|
|
|
|
Fixes bug 696954.
|
|
The file is HORRIBLY corrupt, and triggers Sophos to think it's
PDF malware (which it isn't). It does however trigger a use
after free, worked around here.
|
|
|
|
The code would SEGV if we were trying to synthesise an appearance
stream for an annotation, and the docs pdf resources table
had not been initialised.
We now intialise the pdf resource tables when we initialise a
pdf device. This is the earliest point we know we are going to
need them, and covers all cases.
|
|
This helps with Memento debugging, and looks neater.
|
|
|