freetype2/src/gzip
Ben Wagner 06e21ffedf [gzip] Use exact type for `ft_gzip_alloc` and `ft_gzip_free`.
While a function pointer may be cast to another function pointer
type, it is required to cast the function pointer back to the
original function pointer type before calling it.  If a parameter is
a pointer the exact pointer type is required.  Using a pointer to a
different underlying type is technically undefined behavior.  The
wrapper functions `ft_gzip_alloc` and `ft_gzip_free` took
`FT_Memory` (a `FT_MemoryRec_*`) instead of `voidpf` (`void*`), so
when gzip calls these callbacks through `alloc_func` or `free_func`
it invokes undefined behavior.  On most platforms this works out as
expected, but newer undefined behavior detectors and targets like
wasm can detect this and will produce an error.

* src/gzip/ftgzip.c (ft_gzip_alloc, ft_gzip_free): Update signatures
to exactly match `alloc_func` and `free_func`, respectively.
Internally, cast the `void*` opaque pointer to `FT_Memory`.
2021-05-19 09:07:33 +02:00
..
adler32.c Remove tabs from source files. 2007-06-01 06:56:17 +00:00
ftgzip.c [gzip] Use exact type for `ft_gzip_alloc` and `ft_gzip_free`. 2021-05-19 09:07:33 +02:00
ftzconf.h [gzip] Improve building with external zlib (#49673). 2016-12-01 11:36:37 +01:00
infblock.c * Version 2.10.1 released. 2019-07-01 15:56:34 +02:00
infblock.h 2002-11-05 David Turner <david@freetype.org> 2002-11-06 22:32:54 +00:00
infcodes.c Silence gcc 7's fall-through warnings in `switch' blocks. 2019-05-29 07:51:59 +02:00
infcodes.h 2002-11-05 David Turner <david@freetype.org> 2002-11-06 22:32:54 +00:00
inffixed.h * src/autohint/ahglobal.c (blue_chars), src/winfonts/winfnt.c 2003-10-15 22:20:56 +00:00
inflate.c Silence gcc 7's fall-through warnings in `switch' blocks. 2019-05-29 07:51:59 +02:00
inftrees.c Don't use `register' keyword. Fixes compiler warnings. 2014-08-31 08:47:11 +02:00
inftrees.h * src/autohint/ahglobal.c (blue_chars), src/winfonts/winfnt.c 2003-10-15 22:20:56 +00:00
infutil.c * src/autohint/ahglobal.c (blue_chars), src/winfonts/winfnt.c 2003-10-15 22:20:56 +00:00
infutil.h Minor fixes for recent compilers. 2019-11-23 10:00:02 +01:00
rules.mk Update all copyright notices. 2021-01-17 07:18:48 +01:00
zlib.h [gzip] Improve building with external zlib (#49673). 2016-12-01 11:36:37 +01:00
zutil.c gzip: Use FT2 zcalloc() & zfree() in ftgzip.c by default. 2009-08-01 00:30:11 +09:00
zutil.h Remove tabs from source files. 2007-06-01 06:56:17 +00:00