diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 9e4eebeb08fd5b84b59c580f8221a1fa05b4b3f8..f6b8f462b5a41cee30c33145fd62fa28daa01e92 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -3030,6 +3030,9 @@ static int lib_rFrame2Char(lua_State *L) //HUDSAFE c[0] = R_Frame2Char(ch); + if (c[0] == '\xFF') + return luaL_error(L, "frame %u cannot be represented by a character", ch); + c[1] = 0; lua_pushstring(L, c);