From e59050549285deb717d8a2245586c0b8c2a3d38a Mon Sep 17 00:00:00 2001 From: Fabian Giesen Date: Wed, 7 Jul 2021 02:45:41 -0700 Subject: [PATCH] stb_truetype: GCC warning fix GCC warns about a potentially uninitialized variable here. It's not (or at least I don't see how), but fix it anyway. --- stb_truetype.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stb_truetype.h b/stb_truetype.h index ce32bb3..8b3bd87 100644 --- a/stb_truetype.h +++ b/stb_truetype.h @@ -4624,7 +4624,8 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc float ax = x1-x0, ay = y1-y0; float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; float mx = x0 - sx, my = y0 - sy; - float res[3],px,py,t,it,dist2; + float res[3] = {0.f,0.f,0.f}; + float px,py,t,it,dist2; float a_inv = precompute[i]; if (a_inv == 0.0) { // if a_inv is 0, it's 2nd degree so use quadratic formula float a = 3*(ax*bx + ay*by);