File: Fix_segementation_fault.patch

package info (click to toggle)
lv2file 0.95-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 216 kB
  • sloc: ansic: 1,639; sh: 30; makefile: 24
file content (31 lines) | stat: -rw-r--r-- 1,188 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From f88abbb6449889bb06d75f00f0868d50b34ccdeb Mon Sep 17 00:00:00 2001
From: akwizgran <michael@briarproject.org>
Date: Sat, 15 Nov 2025 12:38:46 +0000
Subject: [PATCH] Fix segfault when plugin offers worker feature.
Forwarded: https://github.com/jeremysalwen/lv2file/pull/10
Bug-Debian: #1087090
---
 lv2file.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lv2file.c b/lv2file.c
index b30dd76..a8a8ba5 100644
--- a/lv2file.c
+++ b/lv2file.c
@@ -771,13 +771,14 @@ if(!clipped && clipOutput (numread * numout, sndfilebuffer)) {
 				features[2] = &options_feature;
 
 				LV2_Worker_Schedule* schedule = NULL;
+				LV2_Feature schedule_feature = { LV2_WORKER__schedule, NULL };
 				if (has_worker) {
 					schedule                = (LV2_Worker_Schedule*)malloc (sizeof (LV2_Worker_Schedule));
 					schedule->handle        = NULL;
 					schedule->schedule_work = lv2_worker_schedule;
 
-					const LV2_Feature schedule_feature = { LV2_WORKER__schedule, schedule };
-					features[n_features++]             = &schedule_feature;
+					schedule_feature.data  = schedule;
+					features[n_features++] = &schedule_feature;
 				}
 
 				features[n_features] = NULL;