summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-10-06 14:34:18 -0400
committerDavid Robillard <d@drobilla.net>2024-10-11 14:10:27 -0400
commit03c3b998151367322e306a33bde2db1837c570e0 (patch)
tree0b5e5955d936682012cd77d371bf4d654cb5e7c9 /tools
parent9cbd0b8e24e752c509164ea52deea09e7ca7a695 (diff)
downloadlilv-03c3b998151367322e306a33bde2db1837c570e0.tar.gz
lilv-03c3b998151367322e306a33bde2db1837c570e0.tar.bz2
lilv-03c3b998151367322e306a33bde2db1837c570e0.zip
Avoid potential null pointer arithmetic
Diffstat (limited to 'tools')
-rw-r--r--tools/lv2bench.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/lv2bench.c b/tools/lv2bench.c
index 4b7eef7..aeb86a0 100644
--- a/tools/lv2bench.c
+++ b/tools/lv2bench.c
@@ -65,13 +65,14 @@ bench(const LilvPlugin* p, uint32_t sample_count, uint32_t block_size)
const LV2_Feature* features[] = {&map_feature, &unmap_feature, NULL};
float* const buf = (float*)calloc(block_size * 2UL, sizeof(float));
- float* const in = buf;
- float* const out = buf + block_size;
if (!buf) {
fprintf(stderr, "Out of memory\n");
return 0.0;
}
+ float* const in = buf;
+ float* const out = buf + block_size;
+
const size_t atom_capacity = 1024;
LV2_Atom_Sequence seq_in = {{sizeof(LV2_Atom_Sequence_Body),