mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[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:
parent
25a14eb232
commit
c5099d30b1
1 changed files with 1 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue