External, Non-PPA KXStudio Repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
983B

  1. From 446232eade7b08360fbadf6d16ed7a1ee7481faf Mon Sep 17 00:00:00 2001
  2. From: Filipe Coelho <falktx@falktx.com>
  3. Date: Wed, 10 Mar 2021 14:00:47 +0000
  4. Subject: [PATCH] eg-sampler: Fix out of bounds sample read after loading new
  5. file
  6. ---
  7. plugins/eg-sampler.lv2/sampler.c | 4 ++++
  8. 1 file changed, 4 insertions(+)
  9. diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
  10. index 6c64df51..1efad3cb 100644
  11. --- a/plugins/eg-sampler.lv2/sampler.c
  12. +++ b/plugins/eg-sampler.lv2/sampler.c
  13. @@ -211,6 +211,10 @@ work_response(LV2_Handle instance, uint32_t size, const void* data)
  14. // Install the new sample
  15. self->sample = *(Sample* const*)data;
  16. + // Stop playing previous sample, which can be larger than new one
  17. + self->frame = 0;
  18. + self->play = false;
  19. +
  20. // Schedule work to free the old sample
  21. SampleMessage msg = {{sizeof(Sample*), self->uris.eg_freeSample}, old_sample};
  22. self->schedule->schedule_work(self->schedule->handle, sizeof(msg), &msg);