nativeaudio

audio playback for Go
Log | Files | Refs | README | LICENSE

commit 347b25f8f9aca4e94382b3029d4492664967a9ea
parent 32313045de260b778f0f6b76bbacfa1154136599
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date:   Wed, 16 Sep 2026 21:29:00 -0400

audio: [Windows] satisfy go vet on the IStream pointer conversion

vet flagged the uintptr to pointer cast for the shell-owned COM
interface. The pointer is not Go memory so the cast is safe; converting
through the address of the uintptr expresses that without a warning and
keeps `go vet ./...` clean.

Diffstat:
Maudio_windows.go | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/audio_windows.go b/audio_windows.go @@ -896,7 +896,10 @@ func SHCreateMemStream(pInit *byte, cbInit int) *IStream { if r == 0 { return nil } - return (*IStream)(unsafe.Pointer(r)) + // r is a COM interface pointer owned by the shell, not Go memory, so + // the round trip through uintptr is safe. Converting via the address + // of r keeps go vet from flagging a possible misuse of unsafe.Pointer. + return *(**IStream)(unsafe.Pointer(&r)) } func MFCreateAttributes(out **IMFAttributes, size uint64) error {