mirror of
https://github.com/godotengine/godot.git
synced 2024-11-26 14:13:10 +00:00
Fix ICONDIR buffer overflow
This commit is contained in:
parent
b05e1e7d69
commit
ffa39db847
@ -1892,7 +1892,7 @@ void DisplayServerWindows::set_native_icon(const String &p_filename) {
|
||||
pos += sizeof(WORD);
|
||||
f->seek(pos);
|
||||
|
||||
icon_dir = (ICONDIR *)memrealloc(icon_dir, 3 * sizeof(WORD) + icon_dir->idCount * sizeof(ICONDIRENTRY));
|
||||
icon_dir = (ICONDIR *)memrealloc(icon_dir, sizeof(ICONDIR) - sizeof(ICONDIRENTRY) + icon_dir->idCount * sizeof(ICONDIRENTRY));
|
||||
f->get_buffer((uint8_t *)&icon_dir->idEntries[0], icon_dir->idCount * sizeof(ICONDIRENTRY));
|
||||
|
||||
int small_icon_index = -1; // Select 16x16 with largest color count.
|
||||
|
Loading…
Reference in New Issue
Block a user