[renderer] Fix access to freed memory loading fonts

QFS_LoadFile closes its file argument (this is a design error resulting
from changing QFS_LoadFile to take a file instead of a path and not
completing the update), resulting in the call to Qfilesize accessing
freed memory.
This commit is contained in:
Bill Currie 2022-09-15 14:32:16 +09:00
parent 25a14eb232
commit c5099d30b1

View file

@ -87,7 +87,7 @@ R_FontLoad (QFile *font_file, int size)
if (!font_data) {
return 0;
}
size_t font_size = Qfilesize (font_file);;
size_t font_size = qfs_filesize;
rfont_t *font = calloc (1, sizeof (rfont_t));
font->font_resource = font_data;
if (FT_New_Memory_Face (ft, font_data, font_size, 0, &font->face)) {