summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-07-24Handle out of range pdf subfunction boundariesSebastian Rasmussen
Any pdf function with incorrect number of subfunction boundaries will either cause an exception or have excessive boundaries be ignored.
2012-07-24Handle exponential pdf functions with malformed constantsTor Andersson
Any pdf functions with incorrect number of constants will have their constant values set to default values. Any excessive constants are ignored.
2012-07-23Warn about out of range values for exponential pdf functionsSebastian Rasmussen
Exponential pdf functions have constraints on their input values so warn about out of range values when loading those functions. When evaluation the functions, assume zero without warning.
2012-07-23Handle sampled pdf function dimensionalitySebastian Rasmussen
Functions that have excessive dimension sizes will have those sizes ignored, whereas functions that have too few dimension sizes will cause an exception.
2012-07-23Handle pdf functions with malformed input/output mappingsSebastian Rasmussen
After this pdf functions that have malformed Decode/Encode arrays with too few/many entries compared to the number of inputs/outputs will be handled more gracefully. Those missing mappings will be set to default values.
2012-07-23Handle pdf function evaluation with wrong number of inputs/outputsSebastian Rasmussen
Functions requiring more inputs than available input values will have those inputs set to zero. Similarly functions producing too few outputs will have the remaining output values be set to zero. Any excessive input values or output values will be ignored.
2012-07-23Handle pdf functions with too many inputsSebastian Rasmussen
Both exponential and stitching functions are limited to having one input. Make sure that any excessive inputs are ignored.
2012-07-23Provide number of inputs/outpus when loading pdf functionsSebastian Rasmussen
This will allow the loading of pdf functions to validate that a pdf function has the correct number of inputs/outputs. Additionally it will allow for handling pdf functions with incorrect number of inputs/outputs.
2012-07-23Clamp number of pdf function inputs/outputsSebastian Rasmussen
Previously a pdf function having too many inputs or outputs would cause and exception, now they will be handled silently. There are two places pdf functions are used: for shadings and for colorspace tint transforms. In both cases the number of inputs/outputs may never be more than the number of components, i.e. limited to MAXN. Additionally the number of inputs/outputs may never be less than than the number of components, and there is always at least one component.
2012-07-23Remove redundant check in pdf function codeSebastian Rasmussen
BitsPerSample is already screened later in the code for invalid values, including the default value 0 returned by pdf_to_int().
2012-07-23Whitespace fixes in code for pdf functions.Sebastian Rasmussen
2012-07-23Fix encryption key length checkSebastian Rasmussen
Encryption keys lengths are expressed in bits, however one check assumed the length was expressed in bytes.
2012-07-23Prefer larger Width value if more than one is given for each glyph.Tor Andersson
Fixes bug #692267
2012-07-23Fallback case for type 1 fonts without encoding and non-standard glyph names.Tor Andersson
Fixes bug #692289
2012-07-23Tweak some font encoding heuristics.Tor Andersson
Always use BaseFont, always ignore font descriptor's FontName.
2012-07-23Only warn if ToUnicode CMap cannot be loaded.Tor Andersson
2012-07-23Don't encode MS-Symbol encoded fonts by glyph names.Tor Andersson
Fix bug http://code.google.com/p/sumatrapdf/issues/detail?id=1618
2012-07-23Use FT_ENCODING_MS_SYMBOL encoding for symbolic TrueType fonts.Tor Andersson
Fixes http://code.google.com/p/sumatrapdf/issues/detail?id=1815
2012-07-20Give precedence to /Subtype field when deciding on font encodings.Tor Andersson
Fixes bug where Symbol is not embedded but encoded as a TrueType but the built-in font is a Type1. http://code.google.com/p/sumatrapdf/issues/detail?id=1310
2012-07-20Prefer the more specific name if BaseName and FontName differ.Tor Andersson
Also strip the subset prefix.
2012-07-20Pass original font name to fz_new_font from PDF interpreter.Tor Andersson
Improves text device output when using substitute fonts. Fixes bug #693019.
2012-07-20Attempt to load CID fonts with invalid cid collections.Tor Andersson
Warn instead of throwing an error. Fixes file in http://code.google.com/p/sumatrapdf/issues/detail?id=1842
2012-07-18Remove pointless test.Robin Watts
Variable i can never be zero at this point. The desired point of testing against i was to ensure that the test did not evaluate true at the first run, and the other parts of the condition are sufficent to ensure this, so just remove the test on i.
2012-07-18Fix missing diagram in 1522*.pdfRobin Watts
Since the commit to replace abs/min/max/clamp with inline versions, "1522 - diagramm missing above 88 pc zoom.pdf" has been missing a diagram. This is because the diagram contains sections like: -2147483648 -2147483648 m -2147483648 2147483647 l 2147483647 2147483647 l 2147483647 -2147483648 l These extreme values, when transformed would give floating point values that when naively cast down to int, flip sign (e.g. extreme positive when cast to int becomes extreme negative). I had been relying on the cast down giving sane results to enable me to use fz_clampi. Revert to using fz_clamp and all is fine.
2012-07-18Fix broken pdf_write functionality.Robin Watts
Since I implemented linearisation, any invocation that hasn't used garbage collection has produced broken files, due to every object being marked as freed. This was because I'd forgotten to ever set the use_list markers to be 1. Fixed here.
2012-07-17Fall back to character path rendering if stroked text uses a dash pattern.Tor Andersson
The FT_Stroker doesn't support dash patterns. Fall back to the normal path rendering, same as with glyphs that are too big to fit the cache.
2012-07-17Handle glyphs that are too large to render as pixmaps.Tor Andersson
2012-07-09Make synthetic font styles match XPS spec more closely.Tor Andersson
Shear by 20 degrees for italic. Use 2% wider metrics for bold.
2012-07-09Remove Symbol,Italic workaround and extend list of alternative names instead.Tor Andersson
2012-07-06Bug 693167: Solve pdfclean -ggg deleting too many objectsRobin Watts
While pdf writing, compactxref would fail to take into account that duplicated objects would have been mapped down to a lower number, and the use_list value for the upper one would be set to zero. Thanks to Zeniko for pointing out this fix.
2012-07-06Improve bounds checking in page tree.Sebastian Rasmussen
2012-07-06Improve bounds checking for image properties.Sebastian Rasmussen
2012-07-06Remove unnecessary check for unsupported crypt revision.Sebastian Rasmussen
2012-07-06Improve bounds checking of encryption key lengthSebastian Rasmussen
2012-07-06Reorder parsing of encryption dict.Sebastian Rasmussen
2012-07-06Make length check for crypt dict entries similar.Sebastian Rasmussen
2012-07-06Defer dereferencing of pdf_crypt until it's needed.Sebastian Rasmussen
2012-07-06Remove debugging functions for release builds.Sebastian Rasmussen
2012-07-06Use pdf_fprintf_obj instead of pdf_print_obj in apps.Sebastian Rasmussen
2012-07-06Whitespace fixes in fitz header.Sebastian Rasmussen
2012-07-05Fix free of uninitialised fontdesc pointer.Robin Watts
If an error occurs early enough we can end up trying to free an uninitialised pointer. Simply set it to NULL to start with. Problem seen with normal1265.pdf
2012-07-05Cope with stray returns at the start of a JPEG stream.Robin Watts
Acrobat seems to cope, we should too. See normal_439.pdf for an example.
2012-07-05Cope with illegal alpha values (out of range)Robin Watts
normal_457.pdf specifies an alpha value of 1.005, which causes overflows when calculating values. Simply clamp values into the 0..1 range.
2012-07-05Move to static inline functions from macros.Robin Watts
Instead of using macros for min/max/abs/clamp, we move to using inline functions. These are more typesafe, and should produce equivalent code on compilers that support inline (i.e. pretty much everything we care about these days). People can always do their own macro versions if they prefer.
2012-07-05Cope with negative lengths being passed to fz_open_nullRobin Watts
normal_994.pdf SEGVs due to a negative length. Simple fix to treat negative length streams as 0 length.
2012-07-05Avoid calling pdf_array_len (and friends) in a loop.Robin Watts
for(i = 0; i < pdf_array_len(x); i++) ... results in lots of calls to pdf_array_len. This is not what we want.
2012-07-05Improve detection of images for pdfwrite.Robin Watts
In pdfwrite we have a flag to say "don't expand images", but this isn't always honoured because we don't know that a stream is an image (for instance the corrupt fax stream used as a thumbnail in normal_439.pdf). Here we update the code to spot that streams are likely to be images based on the filters in use, or on the presence of both Width and Height tags.
2012-07-04Bug 693160: Fix bug in fz_write_buffer_bits.Robin Watts
When writing few enough bits that they would fit into the 'spare' bits in the last byte, I was failing to update the buffer. Also, I was failing to grow the buffer enough, and calculating the wrong number of bits left over in various places. Both fixed here. Thanks to Robert Jedrzejczyk and Sebras!
2012-07-04Reverse order of Y decomposition of mesh shading.Robin Watts
Solves problem seen in torture.pdf - we now match acrobat. Problem derived from normal_262.pdf
2012-07-04Tweak mubusy so it responds to 'pdfclean' as well as 'mupdfclean' etc.Robin Watts