From 60b28d8a78b14ecc43f1c7d177cfa5f8597e2071 Mon Sep 17 00:00:00 2001 From: drkhsh Date: Tue, 23 Jun 2026 19:27:55 +0200 Subject: fix use of uninitialized volume in OSS mixer if no "vol" device exists in the mixer, v was used uninitialized. return early on match and return NULL with a warning otherwise. --- components/volume.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'components') diff --git a/components/volume.c b/components/volume.c index 5a2bfb7..20171da 100644 --- a/components/volume.c +++ b/components/volume.c @@ -211,11 +211,14 @@ close(afd); return NULL; } + close(afd); + return bprintf("%d", v & 0xff); } } close(afd); + warn("vol_perc: no 'vol' mixer device"); - return bprintf("%d", v & 0xff); + return NULL; } #endif -- cgit v1.2.3