From 6eb79d4d8df6c227e0bc75ea3d15a264f99cb365 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Mon, 23 May 2022 15:38:57 +0200 Subject: [PATCH] fix(volume): Fix hard coded stack index --- src/lua_libpulse_glib/volume.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_libpulse_glib/volume.c b/src/lua_libpulse_glib/volume.c index 73c3466..f2e514a 100644 --- a/src/lua_libpulse_glib/volume.c +++ b/src/lua_libpulse_glib/volume.c @@ -27,7 +27,7 @@ int volume_to_lua(lua_State* L, const pa_cvolume* pa_volume) { // by GC. Makes this easier to use. But only do so after the current version has been committed // once, just so it stays available. pa_cvolume* volume_from_lua(lua_State* L, int index) { - switch (lua_type(L, 2)) { + switch (lua_type(L, index)) { case LUA_TTABLE: { uint8_t channels = (uint8_t) lua_objlen(L, index); if (channels > PA_CHANNELS_MAX) {