mirror of
https://github.com/holub/mame
synced 2025-07-05 18:08:04 +03:00
font_sdl: better fix for variable-length array
This commit is contained in:
parent
7cf123e770
commit
2e0798e064
@ -199,7 +199,7 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::TTF_OpenFont_Magic(std::string const &n
|
||||
unsigned char const ttf_magic[] = { 0x00, 0x01, 0x00, 0x00, 0x00 };
|
||||
unsigned char const ttc1_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x01, 0x00, 0x00 };
|
||||
unsigned char const ttc2_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x02, 0x00, 0x00 };
|
||||
unsigned char buffer[8];
|
||||
unsigned char buffer[std::max({ sizeof(ttf_magic), sizeof(ttc1_magic), sizeof(ttc2_magic) })];
|
||||
auto const bytes_read = file.read(buffer, std::size(buffer));
|
||||
file.close();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user