From 60c9d1735fc80f575ccc45838950391d308a9b51 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Thu, 25 Dec 2025 21:50:33 +0100 Subject: [PATCH] fix segfault --- readme.md | 2 ++ src/lua_rds.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 4417454..63a976d 100644 --- a/readme.md +++ b/readme.md @@ -4,6 +4,8 @@ RDS95 is a light software RDS encoder for linux +RDS95 also embeds Lua to implement some things + RDS95 follows the IEC 62106 standard (available at the RDS Forum website) Also, yes i would like to license this under the unlicese but the tyranny of the GPL license restricts me from doing that, this is a message to you, anthony (see the [disclaimer](#disclaimer)) diff --git a/src/lua_rds.c b/src/lua_rds.c index 4111ba5..8ec3b67 100644 --- a/src/lua_rds.c +++ b/src/lua_rds.c @@ -21,8 +21,8 @@ int lua_set_userdata(lua_State *localL) { size_t len; const char *data = luaL_checklstring(localL, 1, &len); if(len > LUA_USER_DATA) return luaL_error(localL, "data exceeds limit"); - memset(&mod->enc->data[mod->enc->program].lua_data, 0, LUA_USER_DATA); - memcpy(&mod->enc->data[mod->enc->program].lua_data, data, len); + memset(mod->enc->data[mod->enc->program].lua_data, 0, LUA_USER_DATA); + memcpy(mod->enc->data[mod->enc->program].lua_data, data, len); return 0; } @@ -33,8 +33,8 @@ int lua_set_userdata_offset(lua_State *localL) { size_t len; const char *data = luaL_checklstring(localL, 3, &len); if(len > size || (offset + size) > LUA_USER_DATA) return luaL_error(localL, "data exceeds limit"); - memset((&mod->enc->data[mod->enc->program].lua_data)+offset, 0, size); - memcpy((&mod->enc->data[mod->enc->program].lua_data)+offset, data, len); + memset(mod->enc->data[mod->enc->program].lua_data + offset, 0, size); + memcpy(mod->enc->data[mod->enc->program].lua_data + offset, data, len); return 0; }