audio/internal/oboe: Nil slice should be safe to convert to reflect.SliceHeader

This commit is contained in:
Hajime Hoshi 2021-06-07 03:33:01 +09:00
parent 658192f83d
commit 61682d6d5c

View File

@ -57,7 +57,7 @@ func Resume() error {
//export ebiten_oboe_read //export ebiten_oboe_read
func ebiten_oboe_read(buf *C.float, len C.size_t) { func ebiten_oboe_read(buf *C.float, len C.size_t) {
s := []float32{} var s []float32
h := (*reflect.SliceHeader)(unsafe.Pointer(&s)) h := (*reflect.SliceHeader)(unsafe.Pointer(&s))
h.Data = uintptr(unsafe.Pointer(buf)) h.Data = uintptr(unsafe.Pointer(buf))
h.Len = int(len) h.Len = int(len)