src/lzw


Log

Author Commit Date CI Message
Werner Lemberg 8521ad99 2016-08-16T13:44:38 [lzw] Optimize last commit. * src/lzw/ftzopen.c (ft_lzwstate_get_code): Move check into conditional clause.
Werner Lemberg 548f68d8 2016-08-16T09:46:40 [lzw] Avoid invalid left shift. * src/lzw/ftzopen.c (ft_lzwstate_get_code): Limit `num_bits'.
Werner Lemberg 8d7b9198 2016-08-16T08:07:58 [lzw] Avoid buffer overrun. Reported as https://bugzilla.mozilla.org/show_bug.cgi?id=1273283 * src/lzw/ftzopen.c (ft_lzwstate_refill): Ensure `buf_size' doesn't underflow.
Werner Lemberg 9adeab64 2016-01-13T11:54:10 Update copyright year.
Werner Lemberg 37412ff9 2016-01-12T21:37:13 Don't use macro names that contain `__' [1/2]. Such macro names are reserved for both C and C++. */*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
Werner Lemberg 41877539 2015-09-26T15:19:54 [bzip2, gzip, lzw] Harmonize function signatures with prototype. Suggested by Hin-Tak Leung. * src/bzip2/ftbzip2.c (ft_bzip2_stream_io), src/gzip/ftgzip.c (ft_gzip_stream_io), src/lzw/ftlzw.c (ft_lzw_stream_io): Do it.
Werner Lemberg 3e587796 2015-03-11T07:14:15 Minor copyright and e-mail address issues.
Werner Lemberg 83d4181a 2015-02-25T08:10:58 [lzw] Signedness fixes. * src/lzw/ftzopen.c, src/lzw/ftzopen.h: Apply.
Werner Lemberg f57fc59e 2015-01-17T20:41:43 Run `src/tools/update-copyright'.
Werner Lemberg f796cf6c 2015-01-17T20:11:10 Normalize copyright notice format.
Werner Lemberg 36d03c9f 2015-01-12T11:26:30 Fix Savannah bug #43976. Assure that FreeType's internal include directories are found before `CPPFLAGS' (which might be set by the user in the environment), and `CPPFLAGS' before `CFLAGS'. * builds/freetype.mk (FT_CFLAGS): Don't add `INCLUDE_FLAGS'. (FT_COMPILE): Make this a special variable for compiling only the files handled in `freetype.mk'. (.c.$O): Removed, unused. * src/*/rules.mk (*_COMPILE): Fix order of include directories.
Werner Lemberg 0098d550 2014-12-07T11:03:57 Uppercase all hex digits for orthogonality.
Werner Lemberg f34f1925 2014-11-26T21:59:21 * src/*: Add checks for parameters of API functions where missing. `API functions' are functions tagged with `FT_EXPORT_DEF'. Besides trivial fixes, the following changes are included, too. * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Set error code if no service is available. * src/base/ftinit.c (FT_Done_FreeType): Change return value for invalid `library' parameter to `Invalid_Library_Handle'. * src/base/ftobjs.c (FT_New_Size): Change return value for invalid `asize' parameter to `Invalid_Argument'. * src/base/ftoutln.c (FT_Outline_Copy): Change return value for invalid `source' and `target' parameters to `Invalid_Outline'. (FT_Outline_Done_Internal): Change return value for invalid `outline' parameter to `Invalid_Outline'.
Werner Lemberg dc624ca4 2013-06-04T10:30:48 Apply fixes for cppcheck nitpicks. http://cppcheck.sourceforge.net/ Note that the current version heavily chokes on FreeType, delivering even wrong results. I will report those issues to the cppcheck team so that a newer version gives improved results hopefully. */* Improve variable scopes. */* Remove redundant initializations which get overwritten. * src/base/ftmac.c ,builds/mac/ftmac.c (count_faces_scalable): Remove unused variable. * src/base/ftdbgmem.c (ft_mem_table_destroy): `table' can't be zero. * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt1_entry_validate): Remove functionless code. * src/tools/ftrandom.c (main): Fix memory leak.
Werner Lemberg e3c93015 2013-03-14T11:21:17 */*: Use FT_Err_Ok only. This is a purely mechanical conversion.
Werner Lemberg 059bc335 2013-03-14T10:27:35 */*: Use `FT_THROW'. This is essentially a mechanical conversion, adding inclusion of `FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for stand-alone compiling modes of the rasterizer modules. To convert the remaining occurrences of FT_Err_XXX and friends it is necessary to rewrite the code. Note, however, that it doesn't harm if some cases are not handled since FT_THROW is a no-op.
Vinnie Falco 26dfeb6d 2012-03-08T06:04:03 Prepare source code for amalgamation. * src\autofit\aferrors.h, src\bdf\bdferror.h, src\bzip2\ftbzip2.c, src\cache\ftcerror.h, src\cff\cfferrs.h, src\cid\ciderrs.h, src\gxvalid\gxverror.h, src\gzip\ftgzip.c, src\lzw\ftlzw.c, src\otvalid\otverror.h, src\pcf\pcferror.h, src\pfr\pfrerror.h, src\psaux\psauxerr.h, src\pshinter\pshnterr.h, src\psnames\psnamerr.h, src\raster\rasterrs.h, src\sfnt\sferrors.h, src\smooth\ftsmerrs.h, src\truetype\tterrors.h, src\type1\t1errors.h, src\type42\t42error.h, src\winfonts\fnterrs.h: Add #undef FT_ERR_PREFIX before #define FT_ERR_PREFIX.
suzuki toshiya 1749d8bc 2012-01-17T02:00:24 Remove trailing spaces.
Tomas Hoger 487913d9 2011-09-11T09:18:10 Slightly improve LZW_CLEAR handling. * src/lzw/ftzopen.c (ft_lzwstate_io) <FT_LZW_PHASE_CODE>: Ensure that subsequent (modulo garbage byte(s)) LZW_CLEAR codes are handled as clear codes. This also re-sets old_code and old_char to predictable values, which is a little better than using `random' ones if the code following LZW_CLEAR is invalid.
Tomas Hoger 83cb6c00 2011-09-11T09:13:45 Add explicit LZW decompression stack size limit. Stack larger than 1<<LZW_MAX_BITS is never needed if prefix table is constructed correctly. It's even less than that, see e.g. libarchive code comment for a better size upper bound: http://code.google.com/p/libarchive/source/browse/trunk/libarchive/archive_read_support_filter_compress.c?r=3635#121 This patch adds explicit stack size limit, enforced when stack is realloced. An alternative is to ensure that code < state->prefix[code - 256] when traversing prefix table. Such check is less efficient and should not be required if prefix table is constructed correctly in the first place. * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Implement it.
Tomas Hoger 86c3c69c 2011-09-11T09:08:40 Protect against loops in the prefix table. LZW decompressor did not sufficiently check codes read from the input LZW stream. A specially-crafted or corrupted input could create a loop in the prefix table, which leads to memory usage spikes, as there's no decompression stack size limit. * src/lzw/ftzopen.c (ft_lzwstate_io) <FT_LZW_PHASE_START>: First code in valid LZW stream must be 0..255. <FT_LZW_PHASE_CODE>: In the special KwKwK case, code == free_ent, code > free_ent is invalid.
suzuki toshiya e62c876b 2011-06-15T02:48:33 Fix g++4.6 compiler warnings in module drivers. The background is same with previous commit. * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Init `points'. (TT_Vary_Get_Glyph_Deltas): Init `delta_xy'. (TT_Get_MM_Var): Init `mmvar'. * src/type1/t1load.c (T1_Get_MM_Var): Ditto. * src/cff/cffdrivr.c (cff_ps_get_font_info): Init `font_info'. * src/cff/cffload.c (cff_index_get_pointers): Init `t'. (cff_font_load): Init `sub'. * src/cff/cffobjs.c (cff_size_init): Init `internal'. (cff_face_init): Init `cff'. * src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps): Init `snaps'. * src/pcf/pcfread.c (pcf_get_properties): Init `properties'. (pcf_get_bitmaps): Init `offsets'. (pcf_get_encodings): Init `tmpEncoding'. * src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'. * src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'. * src/cache/ftcmru.c (FTC_MruList_New): Init `node'. * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and `zip_buff'. * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'. * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'.
Werner Lemberg f765e440 2010-06-24T10:34:29 */*: Use module specific error names where appropriate.
Werner Lemberg fc58155a 2010-01-05T20:00:35 Apply reports from clang static analyzer. * src/lzw/ftlzw.c (ft_lzw_file_init), src/base/ftstroke.c (FT_Stroker_ParseOutline), src/base/ftsynth.c (FT_GlyphSlot_Embolden): Remove dead code. * src/base/ftpatent.c (_tt_check_patents_in_table): Initialize `offset_i'.
suzuki toshiya f420757c 2009-08-01T00:30:14 lzw: Count the size of the memory object by ptrdiff_t.
Oran Agra 1dcd0f23 2009-04-05T18:25:14 Add #error to modules and files that do not support PIC yet. When FT_CONFIG_OPTION_PIC is defined the following files will create #error: * src/bdf/bdfdrivr.h * src/cache/ftcmanag.c * src/cid/cidriver.h * src/gxvalid/gxvmod.h * src/gzip/ftgzip.c * src/lzw/ftlzw.c * src/otvalid/otvmod.h * src/pcf/pcfdrivr.h * src/pfr/pfrdrivr.h * src/psaux/psauxmod.h * src/type1/t1driver.h * src/type42/t42drivr.h * src/winfonts/winfnt.h
Werner Lemberg a49db4f8 2009-03-20T07:30:43 Copyright.
Werner Lemberg 0a05ba25 2009-03-20T07:19:45 Protect against malformed compressed data. Problem reported by Tavis Ormandy <taviso@google.com>. * src/lsw/ftzopen.c (ft_lzwstate_io): Test whether `state->prefix' is zero.
Werner Lemberg 24d72a1b 2009-01-13T17:34:48 Don't use stdlib.h and friends directly. Reported by Mickey Gabel <mickey@monfort.co.il>. * src/base/ftdbgmem.c: s/<stdlib.h>/FT_CONFIG_STANDARD_LIBRARY_H/. * src/gzip/ftgzip.c, src/lzw/ftlzw.c, src/raster/ftmisc.h: s/<string.h>/FT_CONFIG_STANDARD_LIBRARY_H/. * src/autofit/aftypes.h, src/autofit/afhints.c, src/pshinter/pshalgo.c: s/<stdio.h>/FT_CONFIG_STANDARD_LIBRARY_H/ * src/lzw/ftlzw.c, src/base/ftdbgmem.c: Don't include stdio.h.
Werner Lemberg 2b0b4221 2008-05-28T22:17:28 Cosmetic code changes.
Werner Lemberg 1c8980ef 2007-05-25T07:11:12 * docs/CHANGES: Updated. Formatting.
David Turner 3e2f953a 2007-05-22T13:10:59 real fix for bug #19910. the .Z format is really badly designed :-(
David Turner 0d0365ec 2007-05-22T09:53:44 avoid heap explosion in the case of malformed .Z font files related to bug #19910, but not a bugfix yet
Werner Lemberg 4f3b5bbd 2006-05-04T07:13:05 * src/lzw/ftlzw2.c: Renamed to... * src/lzw/ftlzw.c: This. * src/lzw/Jamfile, src/lzw/rules.mk: Updated. * builds/mac/FreeType.m68k_cfm.make.txt, builds/mac/FreeType.m68k_far.make.txt, builds/mac/FreeType.ppc_carbon.make.txt, builds/mac/FreeType.ppc_classic.make.txt: Updated.
Werner Lemberg c6afa122 2006-05-02T22:22:16 * include/freetype/internal/ftmemory.h: s/new/newsz/ (for C++). (FT_ALLOC): Remove redundant redefinition. * builds/compiler/gcc-dev.mk (CFLAGS) [g++]: Don't use `-Wstrict-prototypes'. * src/base/ftstream.c (FT_Stream_EnterFrame): Add cast. Formatting, copyright years.
David Turner 9ca78256 2006-05-02T09:00:29 * include/freetype/internal/ftmemory.h, src/base/ftbitmap.c, src/base/ftmac.c, src/base/ftrfork.c, src/lzw/ftzopen.c, src/raster/ftrend1.c, src/sfnt/ttpost.c, src/truetype/ttgxvar.c, src/type42/t42parse.c, src/winfonts/winfnt.c: hardening the code against out-of-bounds conditions when allocating arrays. This is for the cases where FT_NEW_ARRAY and FT_RENEW_ARRAY are not used already. Introducing the new FT_ALLOC_MULT and FT_REALLOC_MULT macros.
Werner Lemberg 50ef72b6 2006-04-29T07:02:36 * src/lzw/ftlzw.c, src/lzw/zopen.c, src/lzw/zopen.h: Removed, obsolete.
Werner Lemberg af16820a 2006-03-24T12:46:49 Normalize quotation to `...'.
Werner Lemberg 7f049f42 2006-02-25T16:52:16 Formatting, copyright years.
David Turner de271ab8 2006-02-25T14:53:02 * builds/unix/ftsystem.c, include/freetype/config/ftheader.h, include/freetype/internal/services/svotval.h, include/freetype/internal/services/svpfr.h, src/base/ftsystem.c, src/bdf/bdfdrivr.c, src/cache/ftcbasic.c, src/cff/cffcmap.c, src/gzip/ftgzip.c, src/lzw/ftlzw.c, src/lzw/ftlzw2.c, src/psaux/t1cmap.c, src/sfnt/ttbdf.c, src/smooth/ftgrays.c: solved -Wmissing-prototypes warnings with GCC
Werner Lemberg 84cacd23 2005-10-23T19:25:41 formatting, comment clean-up
David Turner 398d64c0 2005-10-21T10:01:25 * src/base/ftdbgmem.c: another realloc memory counting bug fix * src/tools/Jamfile: adding missing file * src/lzw/Jamfile: fixing incorrect source file reference
Werner Lemberg 560d5fed 2005-10-21T09:08:28 Minor cleanups. Copyright issues.
David Turner c1b6d082 2005-10-20T15:33:34 * src/base/ftdbgmem.c: fixes to better account for memory reallocations * src/lzw/ftlzw2.c, src/lzw/ftzopen.h, src/lzw/ftzopen.c, src/lzw/rules.mk: first version of LZW loader re-implementation. Apparently, saves about 260 KB of heap memory when loading tir24.pcf.Z
Werner Lemberg 60a04df7 2005-06-04T23:04:30 Add license.
Werner Lemberg 22ad9ef0 2005-05-09T22:11:36 Handle unsorted SFNT type 4 cmaps correctly (reported by Dirck Blaskey). * src/sfnt/ttcmap.h (TT_CMap): Add member `unsorted'. * src/sfnt/ttcmac.c: Use SFNT_Err_Ok where appropriate. (tt_cmap0_validate, tt_cmap2_validate, tt_cmap6_validate, tt_cmap8_validate, tt_cmap10_validate, tt_cmap12_validate): Use `FT_Error' as return type. (tt_cmap4_validate): Use `FT_Error' as return type. Return error code for unsorted cmap. (tt_cmap4_char_index, tt_cmap4_char_next): Use old code for unsorted cmaps. (tt_face_build_cmaps): Set `unsorted' variable in cmap. Minor formatting.
David Turner 750fa961 2005-05-01T10:11:32 * Jamfile: removing otvalid from the list of compiled modules * include/freetype/internal/ftserv.h: added compiler pragmas to get rid of annoying warnings with Visual C++ compiler in maximum warning mode * src/autofit/afhints.c, src/autofit/aflatin.c, src/base/ftstroke.c, src/bdf/bdfdrivr.c, src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftcmanag.c, src/cff/cffload.c, src/cid/cidload.c, src/lzw/zopen.c, src/otvalid/otvgdef.c, src/pcf/pcfread.c, src/sfnt/sfobjs.c, src/truetype/ttgxvar.c: removing compiler warnings
Werner Lemberg ebf5585d 2005-03-16T01:49:54 Formatting.
David Turner 68df4f73 2005-03-15T18:18:57 * src/bdf/bdflib.c: various improvements to the bdf loader, mainly used to reduce the amount of heap size required to only test wether we're dealing with a BDF font (the old code allocated 64 Kb right before any test). * src/lzw/ftlzw.c (FT_Stream_OpenLZW): modified the function to check the LZW header before doing anything else. This helps avoid un-necessary heap allocations (400 Kb of heap memory for the LZW decoder ! Oh my !) * src/gzip/ftgzip.c (FT_Stream_OpenGZip): ditto for the .gz decoder, though the code savings is smaller.
Werner Lemberg f9b44e30 2004-06-15T13:57:00 * src/lzw/zopen.c: Comment out inclusion of `signal.h' and `unistd.h'.
David Turner 10bf05a3 2004-04-21T14:30:37 * src/cff/cffobjs.c (cff_face_init): fixed a small memory leak * src/autofit/afloader.c, src/autofit/afmodule.c, src/base/ftdebug.c: removed compiler warnings * src/autofit/aftypes.h, src/lzw/zopen.c, src/pcf/pcfdrivr.c, src/pcf/pcfread.c, src/psaux/psobjs.c, src/type42/t42drivr.c: changed data arrays to "const" to avoid populating the ".data" segment
Antoine Leca 497cc7c4 2004-04-12T18:09:00 Jamfile to bring in the new lzw module. My first try at this exercise, please report problems, I lack experience! Antoine
Werner Lemberg 161438c5 2004-04-12T15:31:30 * src/lzw/zopen.c: Don't include sys/param.h and sys/stat.h.
Werner Lemberg 391de1a6 2004-04-11T16:44:54 * src/lzw/ftlzw.c: Include zopen.h dependent on FT_CONFIG_OPTION_USE_LZW. * src/base/ftdebug.c: s/index/idx/ to avoid compiler warnings.
Werner Lemberg 6ea2054f 2004-03-05T10:07:37 Initial revision