From cad6fb038b477865581109ab99dc79ad4b50e79f Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 25 Sep 2016 01:00:20 +0200 Subject: lua: complain loudly if Lua state creation fails This should normally happen only if memory allocation for the state happens, which should be extremely rare. But with Luajit on OSX, it can happen if the magic compiler flags required by Luajit were not passed to mpv compilation. Print an error to reduce confusion. --- player/lua.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/player/lua.c b/player/lua.c index 1ad6bff682..442a2ba073 100644 --- a/player/lua.c +++ b/player/lua.c @@ -377,8 +377,10 @@ static int load_lua(struct mpv_handle *client, const char *fname) } lua_State *L = ctx->state = luaL_newstate(); - if (!L) + if (!L) { + MP_FATAL(ctx, "Could not initialize Lua.\n"); goto error_out; + } if (mp_cpcall(L, run_lua, ctx)) { const char *err = "unknown error"; -- cgit v1.2.3