diff options
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c')
-rw-r--r-- | Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c index 02fe37440c0..f55016122c1 100644 --- a/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c +++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c @@ -4,7 +4,7 @@ * * PNG Bitmap glyph support. * - * Copyright (C) 2013-2021 by + * Copyright (C) 2013-2020 by * Google, Inc. * Written by Stuart Gill and Behdad Esfahbod. * @@ -270,10 +270,7 @@ int bitdepth, color_type, interlace; FT_Int i; - - /* `rows` gets modified within a 'setjmp' scope; */ - /* we thus need the `volatile` keyword. */ - png_byte* *volatile rows = NULL; + png_byte* *rows = NULL; /* pacify compiler */ if ( x_offset < 0 || @@ -430,7 +427,7 @@ goto DestroyExit; } - if ( FT_QNEW_ARRAY( rows, imgHeight ) ) + if ( FT_NEW_ARRAY( rows, imgHeight ) ) { error = FT_THROW( Out_Of_Memory ); goto DestroyExit; @@ -441,11 +438,11 @@ png_read_image( png, rows ); + FT_FREE( rows ); + png_read_end( png, info ); DestroyExit: - /* even if reading fails with longjmp, rows must be freed */ - FT_FREE( rows ); png_destroy_read_struct( &png, &info, NULL ); FT_Stream_Close( &stream ); |