From dc9ff1250c049b5b60cef16f07be4c031ce2fa4c Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Sat, 19 May 2018 14:15:15 +0100 Subject: eg-sampler: Fix segfault on old_sample null deref Fixes a segmentation fault in eg-sampler when a sample is loaded for the first time. Dereferencing old_sample->path causes the NULL pointer segfault. Resolved by always simplifying code to always write_set_file, even if the filename is the same. Signed-off-by: Harry van Haaren --- plugins/eg-sampler.lv2/sampler.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c index 3bd8b6c..aa8a1c1 100644 --- a/plugins/eg-sampler.lv2/sampler.c +++ b/plugins/eg-sampler.lv2/sampler.c @@ -220,13 +220,11 @@ work_response(LV2_Handle instance, old_sample }; self->schedule->schedule_work(self->schedule->handle, sizeof(msg), &msg); - if (strcmp(old_sample->path, new_sample->path)) { - // Send a notification that we're using a new sample - lv2_atom_forge_frame_time(&self->forge, self->frame_offset); - write_set_file(&self->forge, &self->uris, - new_sample->path, - new_sample->path_len); - } + // Send a notification that we're using a new sample + lv2_atom_forge_frame_time(&self->forge, self->frame_offset); + write_set_file(&self->forge, &self->uris, + new_sample->path, + new_sample->path_len); return LV2_WORKER_SUCCESS; } -- cgit v1.2.1