diff options
author | Werner Lemberg <wl@gnu.org> | 2021-03-04 06:41:30 +0100 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2021-03-04 06:41:30 +0100 |
commit | 7227aabb3e45e46cf320f56503656c39f8b63b30 (patch) | |
tree | 4af361b4574ceb46e76782482a713205dc720db0 /src/sfnt/pngshim.c | |
parent | dbf9142f7e0432c9ed618b3276e2b61fa39e7262 (diff) | |
download | freetype2-7227aabb3e45e46cf320f56503656c39f8b63b30.tar.gz |
Revert "[sfnt] Fix crash in `Load_SBit_Png` on Windows x64."
This reverts commit dbf9142f7e0432c9ed618b3276e2b61fa39e7262, as discussed
in #1037.
Diffstat (limited to 'src/sfnt/pngshim.c')
-rw-r--r-- | src/sfnt/pngshim.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c index 2973b9a3c..c7a2938eb 100644 --- a/src/sfnt/pngshim.c +++ b/src/sfnt/pngshim.c @@ -33,16 +33,6 @@ #include "sferrors.h" - /* Use _aligned_malloc / _aligned_free on 64-bit Windows to ensure that */ - /* the jmp_buf needed for ft_setjmp is aligned to a 16-byte boundary. */ - /* If the jmp_buf is not aligned to a 16-byte boundary then a memory */ - /* access violation exception will occur upon ft_setjmp being called. */ -#ifdef _WIN64 -#ifndef PNG_USER_MEM_SUPPORTED -#error "libpng user-defined memory allocation is required for 64-bit Windows" -#endif -#include <malloc.h> -#endif /* This code is freely based on cairo-png.c. There's so many ways */ /* to call libpng, and the way cairo does it is defacto standard. */ @@ -231,32 +221,6 @@ } -#ifdef _WIN64 - - /* Memory allocation callback to ensure that the jmp_buf that is stored */ - /* within the png_struct has 16-byte alignment for 64-bit Windows. */ - static png_voidp - malloc_callback( png_structp png, - png_alloc_size_t size ) - { - FT_UNUSED( png ); - return _aligned_malloc( size, 16 ); - } - - - /* Memory deallocation callback to release memory that was allocated */ - /* with the matching memory allocation callback above. */ - static void - free_callback( png_structp png, - png_voidp ptr ) - { - FT_UNUSED( png ); - _aligned_free( ptr ); - } - -#endif /* _WIN64 */ - - static void read_data_from_FT_Stream( png_structp png, png_bytep data, @@ -328,20 +292,10 @@ FT_Stream_OpenMemory( &stream, data, png_len ); -#ifdef _WIN64 - png = png_create_read_struct_2( PNG_LIBPNG_VER_STRING, - &error, - error_callback, - warning_callback, - NULL, - malloc_callback, - free_callback ); -#else png = png_create_read_struct( PNG_LIBPNG_VER_STRING, &error, error_callback, warning_callback ); -#endif if ( !png ) { error = FT_THROW( Out_Of_Memory ); |