shithub: freetype+ttf2subf

Download patch

ref: e9c50fa77de58b749b4b95706f7b55bfff0dd27f
parent: b0729b8fbb18dc1340ade628facf3f1cee498bfb
author: Alexei Podtelezhnikov <[email protected]>
date: Tue Mar 16 18:12:41 EDT 2021

* src/sfnt/pngshim.c (Load_SBit_Png): Free `rows` once later.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-03-16  Alexei Podtelezhnikov  <[email protected]>
+
+	* src/sfnt/pngshim.c (Load_SBit_Png): Free `rows` once later.
+
 2021-03-16  Ben Wagner  <[email protected]>
 
 	[sfnt] Fix memory leak in png loading.
--- a/src/sfnt/pngshim.c
+++ b/src/sfnt/pngshim.c
@@ -441,11 +441,10 @@
 
     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 );