Hash :
38272bf8
Author :
Date :
2024-12-16T14:29:36
[ftstroke] Fix invalid pointer assignement to `arc` In `FT_Stroker_ConicTo` and `FT_Stroker_CubicTo` there is a `bez_stack`. `arc` is initialized with `arc = bez_stack` and is never set to point into any different object. The main loop looks like `while ( arc >= bez_stack )` which is depending on a later `arc -= 2` (or `arc -= 3`) to make `arc` point to before `bez_stack`. However, using pointer subtraction to make `arc` point outside the array is undefined behavior, and attempting to use the value in the loop predicate is "very" undefined behavior. (C99 "Additive operators" 6.5.6.8.) This particular undefined behavior was discovered as either hangs or MemorySantizer issues after "[InstCombine] Infer nuw for gep inbounds from base of object" [0]. With this change, clang can infer that `arc` must always point into the `bez_stack` object and therefore cannot be at a "negative index" so the predicate is always true. [0] https://github.com/llvm/llvm-project/commit/e21ab4d16b555c28ded307571d138f594f33e325 * src/base/ftstroke.c (FT_Stroker_ConicTo, FT_Stroker_CubicTo): test loop exit condition (there are no more arcs to process) before decrementing `arc` Fixes: #1307
FreeType 2.13.3 =============== Homepage: https://www.freetype.org FreeType is a freely available software library to render fonts. It is written in C, designed to be small, efficient, highly customizable, and portable while capable of producing high-quality output (glyph images) of most vector and bitmap font formats. Please read the `docs/CHANGES` file, it contains IMPORTANT INFORMATION. Read the files `docs/INSTALL*` for installation instructions; see the file `docs/LICENSE.TXT` for the available licenses. For using FreeType's git repository instead of a distribution bundle, please read file `README.git`. Note that you have to actually clone the repository; using a snapshot will not work (in other words, don't use gitlab's 'Download' button). The FreeType 2 API reference is located in directory `docs/reference`; use the file `index.html` as the top entry point. [Please note that currently the search function for locally installed documentation doesn't work due to cross-site scripting issues.] Additional documentation is available as a separate package from our sites. Go to https://download.savannah.gnu.org/releases/freetype/ and download one of the following files. freetype-doc-2.13.3.tar.xz freetype-doc-2.13.3.tar.gz ftdoc2133.zip To view the documentation online, go to https://www.freetype.org/freetype2/docs/ Mailing Lists ------------- The preferred way of communication with the FreeType team is using e-mail lists. general use and discussion: freetype@nongnu.org engine internals, porting, etc.: freetype-devel@nongnu.org announcements: freetype-announce@nongnu.org git repository tracker: freetype-commit@nongnu.org The lists are moderated; see https://www.freetype.org/contact.html how to subscribe. Bugs ---- Please submit bug reports at https://gitlab.freedesktop.org/freetype/freetype/-/issues Alternatively, you might report bugs by e-mail to `freetype-devel@nongnu.org`. Don't forget to send a detailed explanation of the problem -- there is nothing worse than receiving a terse message that only says 'it doesn't work'. Patches ------- For larger changes please provide merge requests at https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests Alternatively, you can send patches to the `freetype-devel@nongnu.org` mailing list -- and thank you in advance for your work on improving FreeType! Details on the process can be found here: https://www.freetype.org/developer.html#patches Enjoy! The FreeType Team ---------------------------------------------------------------------- Copyright (C) 2006-2024 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modified, and distributed under the terms of the FreeType project license, LICENSE.TXT. By continuing to use, modify, or distribute this file you indicate that you have read the license and understand and accept it fully. --- end of README ---