shithub: cstory

Download patch

ref: d1a975478445dd398777222bac963093e99a167e
parent: fcf1e9d0c4850574c14f009f5cfee2f7ac4aa16b
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Sep 7 23:23:36 EDT 2020

Fix uninitialised memory usage

--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -1092,8 +1092,7 @@
 						// Initialise the linked-list
 						for (size_t i = 0; i < TOTAL_GLYPH_SLOTS; ++i)
 						{
-							if (i != 0)
-								font_object->glyphs[i].next = &font_object->glyphs[i - 1];
+							font_object->glyphs[i].next = (i == 0) ? NULL : &font_object->glyphs[i - 1];
 
 							font_object->glyphs[i].x = (i % font_object->atlas_row_length) * atlas_entry_width;
 							font_object->glyphs[i].y = (i / font_object->atlas_row_length) * atlas_entry_height;