1
Fork 0

fix(volume): Fix hard coded stack index

This commit is contained in:
Lucas Schwiderski 2022-05-23 15:38:57 +02:00
parent e0aaa99cb1
commit 6eb79d4d8d
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8

View file

@ -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) {