| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
LZW compression: If the last input byte caused the code width to
increase, the end-of-data code was still output with the old (not yet
increased) code width.
|
|
|
|
|
|
|
|
|
|
| |
_cairo_malloc(0) always returns NULL, but has not been used
consistently. This patch replaces many calls to malloc() with
_cairo_malloc().
Fixes: fdo# 101547
CVE: CVE-2017-9814 Heap buffer overflow at cairo-truetype-subset.c:1299
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
|
|
|
|
|
|
|
|
|
| |
I updated the Free Software Foundation address using the following script.
for i in $(git grep Temple | cut -d: -f1 )
do
sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
|
|
|
|
|
| |
A pending commit will want to include some utility code from cairo and
so we need to extricate the error handling from the PLT symbol hiding.
|
|
|
|
|
| |
Use the gcc likelihood annotation to indicate that allocation failures are
extremely unlikely.
|
|
|
|
|
| |
The error paths should be hit very rarely during normal operation, so mark
them as being unlikely so gcc may emit better code.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Every time we assign or return a hard-coded error status wrap that value
with a call to _cairo_error(). So the idiom becomes:
status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
or
return _cairo_error (CAIRO_STATUS_INVALID_DASH);
This ensures that a breakpoint placed on _cairo_error() will trigger
immediately cairo detects the error.
|
|
|
|
|
|
| |
At some point during the blitz, I accidentally wrote
_cairo_error (CAIRO_STATUS_SUCCESS) and then proceeded to paste it into
the next 30 error sites! s/CAIRO_STATUS_SUCCESS/CAIRO_STATUS_NO_MEMORY/
|
|
|
|
|
| |
Blitz all allocations to ensure that they raise a
_cairo_error(CAIRO_STATUS_NO_MEMORY) on failure.
|
|
|
|
|
| |
Perform similar sanity checks to Vlad's _cairo_malloc_ab() but on the
arguments to realloc instead.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This patch was produced with the following (GNU) sed script:
sed -i -r -e 's/^[ \t]+$//'
run on all *.[ch] files within cairo.
|
| |
|
| |
|
|
|
|
| |
conformance with the LZW compression from libtiff.
|
|
|
|
|
|
|
|
|
|
|
| |
This switches the implementation of _cairo_lzw_compress from using
cairo-hash.c to a custom implementation of the same algorithm that
takes advantage of the specific details of what is needed here.
This final version now has comparable performance to the libtiff code,
but should hopefully be easier to understand.
Add a bunch of comments explaining how the various pieces work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This new implementation is an entirely original work directly from the
description of the LZWDecode filter in the PostScript Language
Reference, (and in spite of the bugs in the examples provided in that
reference).
This implementation uses the existing cairo-hash.c for the symbol
table. This implementation is somewhat easier to read than the libtiff
code, and avoids any code that may have an advertising clause
attached. This new implementation is the simplest thing I could
implement. It is not as efficient as the libtiff code, (though I did
expect better things from cairo-hash.c).
|
|
|
|
| |
list.
|
|
* src/Makefile.am:
Add cairo-lzw.c to sources
Remove erronous space at start of line
* src/cairo-lzw.c:
New file implementing _cairo_compress_lzw which does Lempel-Ziv & Welch
compression as used by postscript. Based on code from libtiff.
* src/cairo-output-stream.c:
Add _cairo_output_stream_write_base85_string which implements
an encoder for the ASCII85Decode postscript filter.
* src/cairoint.h:
Add _cairo_compress_lzw and _cairo_output_stream_write_base85_string.
* src/cairo-ps-surface.c:
Write Images LZW + Base85 encoded.
Change ps level to 2 (we only needed level 3 for FlateDecode).
Change DocumentData to Clean7Bit as we don't include binary data
anymore.
|