mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-07-31 01:09:17 +02:00
fix segfault
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
RDS95 is a light software RDS encoder for linux
|
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)
|
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))
|
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))
|
||||||
|
|||||||
+4
-4
@@ -21,8 +21,8 @@ int lua_set_userdata(lua_State *localL) {
|
|||||||
size_t len;
|
size_t len;
|
||||||
const char *data = luaL_checklstring(localL, 1, &len);
|
const char *data = luaL_checklstring(localL, 1, &len);
|
||||||
if(len > LUA_USER_DATA) return luaL_error(localL, "data exceeds limit");
|
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);
|
memset(mod->enc->data[mod->enc->program].lua_data, 0, LUA_USER_DATA);
|
||||||
memcpy(&mod->enc->data[mod->enc->program].lua_data, data, len);
|
memcpy(mod->enc->data[mod->enc->program].lua_data, data, len);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -33,8 +33,8 @@ int lua_set_userdata_offset(lua_State *localL) {
|
|||||||
size_t len;
|
size_t len;
|
||||||
const char *data = luaL_checklstring(localL, 3, &len);
|
const char *data = luaL_checklstring(localL, 3, &len);
|
||||||
if(len > size || (offset + size) > LUA_USER_DATA) return luaL_error(localL, "data exceeds limit");
|
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);
|
memset(mod->enc->data[mod->enc->program].lua_data + offset, 0, size);
|
||||||
memcpy((&mod->enc->data[mod->enc->program].lua_data)+offset, data, len);
|
memcpy(mod->enc->data[mod->enc->program].lua_data + offset, data, len);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user