From b66330732060af27d0f5414943e1ad378af3d5e3 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 22 Mar 2016 08:26:55 +0100 Subject: [PATCH] * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Minor. This fixes an AddressSanitizer issue: ttgload.c:430:7: runtime error: null pointer passed as argument 1, which is declared to never be null --- ChangeLog | 9 +++++++++ src/truetype/ttgload.c | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5f25e3e73..f3746c374 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2016-03-22 Werner Lemberg + + * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Minor. + + This fixes an AddressSanitizer issue: + + ttgload.c:430:7: runtime error: null pointer passed as argument 1, + which is declared to never be null + 2016-03-21 Werner Lemberg * src/autofit/afhints.c (af_glyph_hints_reload): Thinko. diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 4ab6603a2..d1cb3576d 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -427,7 +427,8 @@ load->glyph->control_len = n_ins; load->glyph->control_data = load->exec->glyphIns; - FT_MEM_COPY( load->exec->glyphIns, p, (FT_Long)n_ins ); + if ( n_ins ) + FT_MEM_COPY( load->exec->glyphIns, p, (FT_Long)n_ins ); } #endif /* TT_USE_BYTECODE_INTERPRETER */