shithub: riscv

Download patch

ref: b15f9ddda1fca69c52f78c4881928f7519a3ef34
parent: 21445d72f3509e0cca405aa182a1a481d0531ced
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Aug 24 12:35:31 EDT 2023

audio/zuke: fix ICY proc running out of stack

--- a/sys/src/cmd/audio/zuke/icy.c
+++ b/sys/src/cmd/audio/zuke/icy.c
@@ -32,7 +32,7 @@
 icyproc(void *b_)
 {
 	char *p, *s, *e;
-	Biobuf *b, out;
+	Biobuf *b, *out;
 	int n, r, sz;
 	Icyaux *aux;
 
@@ -39,12 +39,12 @@
 	threadsetname("icy/pull");
 	b = b_;
 	aux = b->aux;
-	Binit(&out, aux->outfd, OWRITE);
+	out = Bfdopen(aux->outfd, OWRITE);
 	sz = aux->metaint > 4096 ? aux->metaint : 4096;
 	p = malloc(sz);
 	for(;;){
 		r = Breadn(b, p, aux->metaint > 0 ? aux->metaint : sz);
-		if(r < 1 || Bwrite(&out, p, r) != r)
+		if(r < 1 || Bwrite(out, p, r) != r)
 			break;
 		if(aux->metaint > 0){
 			if((n = 16*Bgetc(b)) < 0)
@@ -63,7 +63,7 @@
 	}
 	free(p);
 	Bterm(b);
-	Bterm(&out);
+	Bterm(out);
 	chanclose(aux->newtitle);
 
 	threadexits(nil);