freetype2/src/sfnt
Jesse Towner dbf9142f7e [sfnt] Fix crash in `Load_SBit_Png` on Windows x64.
This change fixes a crash that occurs in `Load_SBit_Png` when
running on a 64-bit Windows OS.  A memory access violation exception
would be raised by `setjmp` if the `jmp_buf` is not aligned to a
16-byte memory boundary.  This is due to setjmp executing `movdqa`
instructions to store 128-bit XMM registers to memory, which require
correct memory alignment.  This problem occurs because
`png_create_read_struct` uses `malloc` and `free` for memory
management, which only guarantees 8-byte alignment on Windows.

Instead, to fix the problem, `png_create_read_struct_2` is used on
64-bit Windows, which allows for user-defined memory allocation and
deallocation callbacks to be specified.  These callbacks forward the
allocation and deallocation requests to `_aligned_alloc` and
`_aligned_free`, ensuring that the allocated `png_struct` and
internal `jmp_buf` have the requisite 16-byte alignment.

* src/sfnt/pngshim.c <_WIN64>: Include `malloc.h`.
(malloc_callback, free_callback) <_WIN64>: New functions.
(Load_SBit_Png) <_WIN64>: Use `png_create_read_struct_2` instead of
`png_create_read_struct`
2021-02-27 13:28:13 +01:00
..
module.mk Update all copyright notices. 2021-01-17 07:18:48 +01:00
pngshim.c [sfnt] Fix crash in `Load_SBit_Png` on Windows x64. 2021-02-27 13:28:13 +01:00
pngshim.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
rules.mk Update all copyright notices. 2021-01-17 07:18:48 +01:00
sfdriver.c * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`. 2021-02-04 07:46:46 +01:00
sfdriver.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
sferrors.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
sfnt.c Update all copyright notices. 2021-01-17 07:18:48 +01:00
sfobjs.c Update all copyright notices. 2021-01-17 07:18:48 +01:00
sfobjs.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
sfwoff.c Decorate qsort callbacks with cdecl. 2021-02-12 19:28:05 -05:00
sfwoff.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
sfwoff2.c [woff2] Fix memory leak. 2021-02-25 20:00:07 +01:00
sfwoff2.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttbdf.c Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttbdf.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttcmap.c Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttcmap.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttcmapc.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttcolr.c [sfnt] Update paint format values to support non-variable paints. 2021-02-16 13:15:41 +01:00
ttcolr.h [sfnt] Provide optional root transform for 'COLR' v1 glyph graph. 2021-02-10 18:51:04 +01:00
ttcpal.c Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttcpal.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttkern.c Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttkern.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttload.c * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`. 2021-02-04 07:46:46 +01:00
ttload.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttmtx.c Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttmtx.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttpost.c Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttpost.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
ttsbit.c * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`. 2021-02-04 07:46:46 +01:00
ttsbit.h Update all copyright notices. 2021-01-17 07:18:48 +01:00
woff2tags.c Update all copyright notices. 2021-01-17 07:18:48 +01:00
woff2tags.h Update all copyright notices. 2021-01-17 07:18:48 +01:00