summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-20 06:16:12 +0000
committerDavid Robillard <d@drobilla.net>2012-03-20 06:16:12 +0000
commite6f61d105c1536f6821977f94927ef70f9bfe7d7 (patch)
treeb442bc0dbd8fe1f5bae2652d8a580ca7bb5839fc /src
parent9f2a60b5461084bf2f1f0f84e5694f90b67d4873 (diff)
downloadsuil-e6f61d105c1536f6821977f94927ef70f9bfe7d7.tar.gz
suil-e6f61d105c1536f6821977f94927ef70f9bfe7d7.tar.bz2
suil-e6f61d105c1536f6821977f94927ef70f9bfe7d7.zip
Fix broken initialisation of features array.
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@4092 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/x11_in_gtk2.c7
-rw-r--r--src/x11_in_qt4.cpp7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/x11_in_gtk2.c b/src/x11_in_gtk2.c
index 0fae7a5..4ef06c9 100644
--- a/src/x11_in_gtk2.c
+++ b/src/x11_in_gtk2.c
@@ -115,14 +115,15 @@ suil_wrapper_new(SuilHost* host,
wrapper->impl = wrap;
wrapper->features = (LV2_Feature**)malloc(
- sizeof(LV2_Feature) * (n_features + 1));
- memcpy(wrapper->features, features, sizeof(LV2_Feature) * n_features);
+ sizeof(LV2_Feature*) * (n_features + 2));
+ memcpy(wrapper->features, features, sizeof(LV2_Feature*) * n_features);
LV2_Feature* parent_feature = (LV2_Feature*)malloc(sizeof(LV2_Feature));
parent_feature->URI = NS_UI "parent";
parent_feature->data = (void*)(intptr_t)gtk_plug_get_id(wrap->plug);
- wrapper->features[n_features] = parent_feature;
+ wrapper->features[n_features] = parent_feature;
+ wrapper->features[n_features + 1] = NULL;
return wrapper;
}
diff --git a/src/x11_in_qt4.cpp b/src/x11_in_qt4.cpp
index e407ccc..23eae5e 100644
--- a/src/x11_in_qt4.cpp
+++ b/src/x11_in_qt4.cpp
@@ -54,14 +54,15 @@ suil_wrapper_new(SuilHost* host,
wrapper->impl = ew;
wrapper->features = (LV2_Feature**)malloc(
- sizeof(LV2_Feature) * (n_features + 1));
- memcpy(wrapper->features, features, sizeof(LV2_Feature) * n_features);
+ sizeof(LV2_Feature*) * (n_features + 2));
+ memcpy(wrapper->features, features, sizeof(LV2_Feature*) * n_features);
LV2_Feature* parent_feature = (LV2_Feature*)malloc(sizeof(LV2_Feature));
parent_feature->URI = NS_UI "parent";
parent_feature->data = (void*)(intptr_t)ew->winId();
- wrapper->features[n_features] = parent_feature;
+ wrapper->features[n_features] = parent_feature;
+ wrapper->features[n_features + 1] = NULL;
return wrapper;
}