diff --git a/code/client/libmumblelink.c b/code/client/libmumblelink.c index a18c6e8e..e2e1c42b 100644 --- a/code/client/libmumblelink.c +++ b/code/client/libmumblelink.c @@ -111,6 +111,7 @@ int mumble_link(const char* name) } close(shmfd); #endif + memset(lm, 0, sizeof(LinkedMem)); mbstowcs(lm->name, name, sizeof(lm->name)); return 0; @@ -127,12 +128,12 @@ void mumble_update_coordinates2(float fAvatarPosition[3], float fAvatarFront[3], if (!lm) return; - memcpy(lm->fAvatarPosition, fAvatarPosition, sizeof(fAvatarPosition)); - memcpy(lm->fAvatarFront, fAvatarFront, sizeof(fAvatarFront)); - memcpy(lm->fAvatarTop, fAvatarTop, sizeof(fAvatarTop)); - memcpy(lm->fCameraPosition, fCameraPosition, sizeof(fCameraPosition)); - memcpy(lm->fCameraFront, fCameraFront, sizeof(fCameraFront)); - memcpy(lm->fCameraTop, fCameraTop, sizeof(fCameraTop)); + memcpy(lm->fAvatarPosition, fAvatarPosition, sizeof(lm->fAvatarPosition)); + memcpy(lm->fAvatarFront, fAvatarFront, sizeof(lm->fAvatarFront)); + memcpy(lm->fAvatarTop, fAvatarTop, sizeof(lm->fAvatarTop)); + memcpy(lm->fCameraPosition, fCameraPosition, sizeof(lm->fCameraPosition)); + memcpy(lm->fCameraFront, fCameraFront, sizeof(lm->fCameraFront)); + memcpy(lm->fCameraTop, fCameraTop, sizeof(lm->fCameraTop)); lm->uiVersion = 2; lm->uiTick = GetTickCount(); } @@ -151,6 +152,7 @@ void mumble_set_context(const unsigned char* context, size_t len) if (!lm) return; len = MIN(sizeof(lm->context), len); + lm->context_len = len; memcpy(lm->context, context, len); }