Fix more UBSan warnings on adding offset to nullptr (#57384)

* src/smooth/ftsmooth.c (ft_smooth_render_generic),
src/psaux/psobjs.c (ps_table_add): Use `FT_OFFSET'.
GSoC-2020-greg
Dominik Röttsches 5 years ago committed by Werner Lemberg
parent dfc9a049de
commit 11d4ce23ac
  1. 7
      ChangeLog
  2. 2
      src/psaux/psobjs.c
  3. 4
      src/smooth/ftsmooth.c

@ -1,3 +1,10 @@
2019-12-09 Dominik Röttsches <drott@chromium.org>
Fix more UBSan warnings on adding offset to nullptr (#57384).
* src/smooth/ftsmooth.c (ft_smooth_render_generic),
src/psaux/psobjs.c (ps_table_add): Use `FT_OFFSET'.
2019-12-05 Werner Lemberg <wl@gnu.org>
* src/truetype/ttinterp.c (TT_RunIns): Use `FT_OFFSET'.

@ -214,7 +214,7 @@
}
/* add the object to the base block and adjust offset */
table->elements[idx] = table->block + table->cursor;
table->elements[idx] = FT_OFFSET( table->block, table->cursor );
table->lengths [idx] = length;
FT_MEM_COPY( table->block + table->cursor, object, length );

@ -188,7 +188,7 @@
/* implode outline if needed */
{
FT_Vector* points = outline->points;
FT_Vector* points_end = points + outline->n_points;
FT_Vector* points_end = FT_OFFSET( points, outline->n_points );
FT_Vector* vec;
@ -207,7 +207,7 @@
/* deflate outline if needed */
{
FT_Vector* points = outline->points;
FT_Vector* points_end = points + outline->n_points;
FT_Vector* points_end = FT_OFFSET( points, outline->n_points );
FT_Vector* vec;

Loading…
Cancel
Save