Browse Source

Fix wine-64bit bridge crash, safely fail instead (related to #124)

tags/1.9.4
falkTX 10 years ago
parent
commit
666f91c2ef
2 changed files with 11 additions and 6 deletions
  1. +6
    -6
      source/backend/engine/CarlaEngineBridge.cpp
  2. +5
    -0
      source/modules/jackbridge/JackBridge2.cpp

+ 6
- 6
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -61,13 +61,13 @@ CARLA_BACKEND_START_NAMESPACE
struct BridgeAudioPool {
CarlaString filename;
float* data;
char shm[32];
char shm[64];

BridgeAudioPool() noexcept
: filename(),
data(nullptr)
{
carla_zeroChar(shm, 32);
carla_zeroChar(shm, 64);
jackbridge_shm_init(shm);
}

@@ -104,13 +104,13 @@ struct BridgeAudioPool {
struct BridgeRtControl : public CarlaRingBuffer<StackBuffer> {
CarlaString filename;
BridgeRtData* data;
char shm[32];
char shm[64];

BridgeRtControl() noexcept
: filename(),
data(nullptr)
{
carla_zeroChar(shm, 32);
carla_zeroChar(shm, 64);
jackbridge_shm_init(shm);
}

@@ -165,13 +165,13 @@ struct BridgeRtControl : public CarlaRingBuffer<StackBuffer> {
struct BridgeNonRtControl : public CarlaRingBuffer<BigStackBuffer> {
CarlaString filename;
BridgeNonRtData* data;
char shm[32];
char shm[64];

BridgeNonRtControl() noexcept
: filename(),
data(nullptr)
{
carla_zeroChar(shm, 32);
carla_zeroChar(shm, 64);
jackbridge_shm_init(shm);
}



+ 5
- 0
source/modules/jackbridge/JackBridge2.cpp View File

@@ -161,26 +161,31 @@ bool jackbridge_sem_timedwait(void* sem, int secs) noexcept

bool jackbridge_shm_is_valid(const void* shm) noexcept
{
CARLA_SAFE_ASSERT_RETURN(shm != nullptr, false);
return carla_is_shm_valid(*(const shm_t*)shm);
}

void jackbridge_shm_init(void* shm) noexcept
{
CARLA_SAFE_ASSERT_RETURN(shm != nullptr,);
carla_shm_init(*(shm_t*)shm);
}

void jackbridge_shm_attach(void* shm, const char* name) noexcept
{
CARLA_SAFE_ASSERT_RETURN(shm != nullptr,);
*(shm_t*)shm = carla_shm_attach(name);
}

void jackbridge_shm_close(void* shm) noexcept
{
CARLA_SAFE_ASSERT_RETURN(shm != nullptr,);
carla_shm_close(*(shm_t*)shm);
}

void* jackbridge_shm_map(void* shm, size_t size) noexcept
{
CARLA_SAFE_ASSERT_RETURN(shm != nullptr, nullptr);
return carla_shm_map(*(shm_t*)shm, size);
}



Loading…
Cancel
Save