internal/pipewire: zero size before validation

Leftover values from previous invocations cause incorrect behaviour here.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-11-25 12:21:37 +09:00
parent fc3d78fe01
commit b1b27ac1df

View File

@@ -260,6 +260,7 @@ func unmarshalValue(data []byte, v reflect.Value, sizeP *Word) error {
return nil return nil
case reflect.Struct: case reflect.Struct:
*sizeP = 0
if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_Struct, sizeP); err != nil { if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_Struct, sizeP); err != nil {
return err return err
} }
@@ -294,6 +295,7 @@ func unmarshalValue(data []byte, v reflect.Value, sizeP *Word) error {
} }
case reflect.String: case reflect.String:
*sizeP = 0
if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_String, sizeP); err != nil { if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_String, sizeP); err != nil {
return err return err
} }