Age | Commit message (Collapse) | Author |
|
|
|
|
|
If Bitmap.lockPixels fails with an allocation error, scavenge in
the store.
|
|
|
|
|
|
_WIN32 is always defined on windows (it means the WinAPI is available).
_WIN64 is also defined on 64-bit targets.
This means the test for defined(_WIN32) || defined(_WIN64) is redundant,
since if _WIN64 is defined, then _WIN32 is always also defined.
MSC_VER is only defined for MSVC, so split the ifdef sections in
include/fitz/system.h into separate MSVC and WIN32 parts so that
we can build with MinGW and other non-MSVC compilers on windows.
|
|
Don't create a useless pdf_font_desc when writing font resources.
Simplify reference counting by using fewer intermediate variables.
|
|
|
|
|
|
|
|
Without this fix the stack may be resized and relocated and
then the scissor might point to stale memory.
|
|
|
|
Rather than looking at their individual scale factors, they
were looking at the global one.
|
|
|
|
When rendering dash lines with a dash pattern that starts with
a length of zero, the first dash should be of zero length. If
we are using round caps, this should actually show up!
|
|
The progress figures did not correctly add up to progress_max.
Now they do. In addition, if we abort, the progress figure
will accurately indicate how far we got.
|
|
aa.text_bits should be 0 when using the 'any' or 'center' rasterizers.
|
|
|
|
|
|
|
|
|
|
|
|
We were previously using the font's family as its name. Now if only one
of family and style are defined we use that. If both are present we
concatenate family and style with an intervening space, unless style
already has family as a prefix, in which case we just use the style.
Better would be to use the font's full name, but that is more difficult
to obtain via the freetype API.
|
|
|
|
Previously the call to fz_convert_pixmap() threw causing a destination
pixmap leak. This illustrated a bigger issue with the error handling
so now all types of pixmaps are dropped and care is taken to also end
the knockout group, should there be any.
|
|
Call these from the PDF interpreter. Make the DisplayList and
Trace devices cope.
Use these in the SVG output device.
|
|
Previously the trailing null terminator would not be written if the
formatted string ended up longer than the buffer.
|
|
|
|
|
|
|
|
fz_write_byte forgot to write the byte after needing to flush
the buffer.
|
|
SIZE_MAX is surprisingly supposed to be in stdint.h, but Android
headers for API levels < 21 accidentally put SIZE_MAX in limits.h.
Headers for API levels >= 21 correctly moved SIZE_MAX to stdint.h.
This is the situation for Android NDK r14 and earlier.
Android NDK r15 and later implement a header unification strategy:
all sets of headers for each API level are combined into a single
set of headers covering all API levels. Any differences are
expressed by #ifdeffing on __ANDROID_API__. When this was done
the moving of SIZE_MAX from limits.h to stdint.h was kept and,
importantly, no #ifdefs were used in limits.h/stdint.h concerning
SIZE_MAX. This means that the move of SIZE_MAX was retroactively
introduced for API levels < 21 in Android NDK r15 and later.
For this reason whenever mupdf uses SIZE_MAX it must include both:
* stdint.h (not just in order to follow the POSIX specification,
but also to compile successfully using Android NDK r15 and later)
* and limits.h (in order to compile successfully using Android NDK
r14 and earlier)
Hence these need to include both stdint.h and limits.h, because:
* source/fitz/memory.c uses SIZE_MAX
* source/fitz/store.c uses SIZE_MAX
The mupdf header include/mupdf/fitz/system.h includes stdint.h so
any file that includes system.h will automatically have stdint.h
This is true for both files. limits.h on the other hand needs to
be explicitly included by whomever uses SIZE_MAX. This was already
done by source/fitz/store.c but not by source/fitz/memory.c, but
has now been added.
|
|
|
|
Previously mupdf would silently ignore this situation and leave the
buffer uninitialized leading to further issues. Thanks to oss-fuzz
for reporting.
|
|
Thanks to oss-fuzz for reporting.
|
|
|
|
|
|
This is needed to simplify the way the bytes for hashing are
passed to pkcs7 functions.
|
|
For TIFF it was not just the colorspace, but other data as well.
|
|
|
|
|
|
A lot of EPUB pool allocated data is much smaller than the default size,
leading to a lot of wasted memory.
|
|
|
|
If fz_new_pixmap_with_bbox() threw conv would be NULL and temp would
be pointing to a pixmap that would be dropped 2 times.
If fz_clone_pixmap_area_with_different_seps() threw temp and conv
would be pointing to the same pixmap that would be dropped 3 times.
|
|
Without this change future calls to fz_fin_cached_color_converter()
will try to dereference the already freed pointer.
|
|
|
|
|
|
|
|
An earlier commit changed the mode used to open a file for saving so that
it could also be read from. The mode used was rb+ independently of whether
the saving mode was incremental or not. Doing so neglected that for
non-incemental saves the file may not already exist in which case opening
rb+ will fail. This commit arranges that wb+ is used in the non-incremental
case.
|
|
This provides a way for some output streams to also be read, a feature
needed for the sake of document signing. Currently this is supported only
for file output.
|