aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-25 12:21:37 +0900
committerOphestra <cat@gensokyo.uk>2025-11-25 12:21:37 +0900
commitb1b27ac1df43d39b856983b4e930204b1a0f2e71 (patch)
treecd617fc02caf606f3ac57697b86104a9c48b2fb0
parentfc3d78fe010f9e3c22a058723bf816570553c0da (diff)
internal/pipewire: zero size before validation
Leftover values from previous invocations cause incorrect behaviour here. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/pipewire/pod.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/pipewire/pod.go b/internal/pipewire/pod.go
index 6281913d..9fb9c784 100644
--- a/internal/pipewire/pod.go
+++ b/internal/pipewire/pod.go
@@ -260,6 +260,7 @@ func unmarshalValue(data []byte, v reflect.Value, sizeP *Word) error {
return nil
case reflect.Struct:
+ *sizeP = 0
if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_Struct, sizeP); err != nil {
return err
}
@@ -294,6 +295,7 @@ func unmarshalValue(data []byte, v reflect.Value, sizeP *Word) error {
}
case reflect.String:
+ *sizeP = 0
if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_String, sizeP); err != nil {
return err
}