summaryrefslogtreecommitdiff
path: root/src/cairo-lzw.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixed crash in _cairo_lzw_compress for 1 byte inputDaniel Hammerschmid2022-12-281-1/+4
|
* Fix output of EOD code with incorrect code width in _cairo_lzw_compressDaniel Hammerschmid2022-10-041-3/+3
| | | | | | 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.
* Use _cairo_malloc instead of mallocAdrian Johnson2018-05-071-1/+1
| | | | | | | | | | _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>
* Update FSF addressAndrea Canciani2010-04-271-1/+1
| | | | | | | | | | | 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
* Move _cairo_error() to a standalone headerChris Wilson2010-01-221-0/+1
| | | | | 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.
* Mark allocation failures as unlikely.Chris Wilson2008-11-291-2/+2
| | | | | Use the gcc likelihood annotation to indicate that allocation failures are extremely unlikely.
* Mark if(status) as being unlikely.Chris Wilson2008-11-291-2/+2
| | | | | The error paths should be hit very rarely during normal operation, so mark them as being unlikely so gcc may emit better code.
* [src/check-doc-syntax.sh] Fix some bugs in the check and fix errors foundBehdad Esfahbod2008-05-091-1/+1
|
* [doc] Replace 'NOTE' by 'Note' and add it to testBehdad Esfahbod2008-01-281-2/+2
|
* [doc] Make sure all macro names in docs are prefixed by %Behdad Esfahbod2008-01-281-7/+7
|
* [cairo-error] Clean up all the warnings and missing _cairo_error() calls.Chris Wilson2007-10-041-4/+2
| | | | | | | | | | | 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.
* [malloc/error] Fixup _cairo_error (CAIRO_STATUS_SUCCESS)!Chris Wilson2007-10-041-2/+2
| | | | | | 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/
* [malloc/error] Add call to _cairo_error() after a failed malloc.Chris Wilson2007-10-041-0/+2
| | | | | Blitz all allocations to ensure that they raise a _cairo_error(CAIRO_STATUS_NO_MEMORY) on failure.
* [malloc] Check for integer overflow when realloc'ing.Chris Wilson2007-10-041-1/+5
| | | | | Perform similar sanity checks to Vlad's _cairo_malloc_ab() but on the arguments to realloc instead.
* Spell check the docsBehdad Esfahbod2007-01-071-1/+1
|
* Fix few remaining compiler warnings, revealed by -O3Behdad Esfahbod2006-08-081-6/+5
|
* Remove extraneous whitespace from "blank" lines.Carl Worth2006-06-061-1/+1
| | | | | | | | This patch was produced with the following (GNU) sed script: sed -i -r -e 's/^[ \t]+$//' run on all *.[ch] files within cairo.
* Remove cairo_public from _cairo_lzw_compress() definition.Kristian Høgsberg2006-05-281-1/+1
|
* Quiet some 'may be used uninitialized' warnings.Carl Worth2006-05-031-2/+2
|
* _cairo_lzw_compress: Remove unused code which we had for testingCarl Worth2006-03-231-13/+0
| | | | conformance with the LZW compression from libtiff.
* Optimize the implementation of _cairo_lzw_compress.Carl Worth2006-03-231-160/+217
| | | | | | | | | | | 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.
* cairo-lzw: Replace LZW code from libtiff with an original implementation.Carl Worth2006-03-231-426/+283
| | | | | | | | | | | | | | 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).
* Rename _cairo_compress_lzw to _cairo_lzw_compress and tighten the parameter ↵Carl Worth2006-03-231-4/+4
| | | | list.
* Add LZW image compression and ASCII85 encoding for PostScript image output.Alexander Larsson2006-03-151-0/+499
* 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.