diff --git a/src/auto4_lua.cpp b/src/auto4_lua.cpp index 8e4c73641..b5e381fe1 100644 --- a/src/auto4_lua.cpp +++ b/src/auto4_lua.cpp @@ -201,25 +201,25 @@ namespace { } } - std::shared_ptr check_VideoFrame(lua_State *L) { + std::shared_ptr *check_VideoFrame(lua_State *L) { auto framePtr = static_cast*>(luaL_checkudata(L, 1, "VideoFrame")); - return *framePtr; + return framePtr; } int FrameWidth(lua_State *L) { - std::shared_ptr frame = check_VideoFrame(L); + std::shared_ptr frame = *check_VideoFrame(L); push_value(L, frame->width); return 1; } int FrameHeight(lua_State *L) { - std::shared_ptr frame = check_VideoFrame(L); + std::shared_ptr frame = *check_VideoFrame(L); push_value(L, frame->height); return 1; } int FramePixel(lua_State *L) { - std::shared_ptr frame = check_VideoFrame(L); + std::shared_ptr frame = *check_VideoFrame(L); size_t x = lua_tointeger(L, -2); size_t y = lua_tointeger(L, -1); lua_pop(L, 2); @@ -239,7 +239,7 @@ namespace { } int FramePixelFormatted(lua_State *L) { - std::shared_ptr frame = check_VideoFrame(L); + std::shared_ptr frame = *check_VideoFrame(L); size_t x = lua_tointeger(L, -2); size_t y = lua_tointeger(L, -1); lua_pop(L, 2); @@ -259,8 +259,8 @@ namespace { } int FrameDestroy(lua_State *L) { - std::shared_ptr frame = check_VideoFrame(L); - frame.~shared_ptr(); + std::shared_ptr *frame = check_VideoFrame(L); + frame->~shared_ptr(); return 0; }