mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-05 06:33:50 +02:00
lv2: fix memory leak and segfault
This commit is contained in:
parent
cb1ba97f1f
commit
09466bc44d
3 changed files with 71 additions and 4 deletions
25
srcpkgs/lv2/patches/fix-memory-leak.patch
Normal file
25
srcpkgs/lv2/patches/fix-memory-leak.patch
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
From f8fdd7a48d12465d2ef8153d25337593c88687e3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Robillard <d@drobilla.net>
|
||||||
|
Date: Sun, 12 Feb 2017 18:20:31 +0100
|
||||||
|
Subject: Fix memory leak
|
||||||
|
|
||||||
|
---
|
||||||
|
plugins/eg-sampler.lv2/sampler.c | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git plugins/eg-sampler.lv2/sampler.c plugins/eg-sampler.lv2/sampler.c
|
||||||
|
index ca92a9c..95cb45e 100644
|
||||||
|
--- plugins/eg-sampler.lv2/sampler.c
|
||||||
|
+++ plugins/eg-sampler.lv2/sampler.c
|
||||||
|
@@ -564,6 +564,8 @@ restore(LV2_Handle instance,
|
||||||
|
free(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ free(path);
|
||||||
|
+
|
||||||
|
return LV2_STATE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
cgit v1.2.1
|
||||||
|
|
42
srcpkgs/lv2/patches/fix-segfault.patch
Normal file
42
srcpkgs/lv2/patches/fix-segfault.patch
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
From dc9ff1250c049b5b60cef16f07be4c031ce2fa4c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Harry van Haaren <harryhaaren@gmail.com>
|
||||||
|
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 <harryhaaren@gmail.com>
|
||||||
|
---
|
||||||
|
plugins/eg-sampler.lv2/sampler.c | 12 +++++-------
|
||||||
|
1 file changed, 5 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git plugins/eg-sampler.lv2/sampler.c plugins/eg-sampler.lv2/sampler.c
|
||||||
|
index 3bd8b6c..aa8a1c1 100644
|
||||||
|
--- plugins/eg-sampler.lv2/sampler.c
|
||||||
|
+++ 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
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
# Template file for 'lv2'
|
# Template file for 'lv2'
|
||||||
pkgname=lv2
|
pkgname=lv2
|
||||||
version=1.14.0
|
version=1.14.0
|
||||||
revision=1
|
revision=2
|
||||||
lib32disabled=yes
|
|
||||||
build_style=waf
|
build_style=waf
|
||||||
homepage="http://lv2plug.in"
|
|
||||||
hostmakedepends="python"
|
hostmakedepends="python"
|
||||||
makedepends="libsndfile-devel gtk+-devel"
|
makedepends="libsndfile-devel gtk+-devel"
|
||||||
short_desc="Plugin standard for audio systems"
|
short_desc="Plugin standard for audio systems"
|
||||||
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
||||||
license="LGPL-2.1, BSD"
|
license="ISC"
|
||||||
|
homepage="http://lv2plug.in"
|
||||||
distfiles="http://lv2plug.in/spec/${pkgname}-${version}.tar.bz2"
|
distfiles="http://lv2plug.in/spec/${pkgname}-${version}.tar.bz2"
|
||||||
checksum=b8052683894c04efd748c81b95dd065d274d4e856c8b9e58b7c3da3db4e71d32
|
checksum=b8052683894c04efd748c81b95dd065d274d4e856c8b9e58b7c3da3db4e71d32
|
||||||
|
lib32disabled=yes
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
vlicense COPYING
|
vlicense COPYING
|
||||||
|
|
Loading…
Add table
Reference in a new issue