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 GitHub
parent 2638e9636b
commit b7e9ca6585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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");