do not allow users to create an empty font group (#1303)

This commit is contained in:
Takase 2023-01-04 23:46:08 +08:00 committed by takase1121
parent bd4e64cc7e
commit 69ce580970
No known key found for this signature in database
GPG Key ID: 60EEFFC68EB3031B
1 changed files with 2 additions and 0 deletions

View File

@ -145,6 +145,8 @@ static int f_font_group(lua_State* L) {
luaL_checktype(L, 1, LUA_TTABLE);
table_size = lua_rawlen(L, 1);
if (table_size <= 0)
return luaL_error(L, "failed to create font group: table is empty");
if (table_size > FONT_FALLBACK_MAX)
return luaL_error(L, "failed to create font group: table size too large");