Open
Description
macOS Version(s) Used to Build
macOS 13 Ventura
Xcode Version(s)
Xcode 14
Description
Hello,
I experience crashes with invalid NIL in the following function of Renderer.swift:
func selectBuffers(width: CGFloat) -> (MTLBuffer, MTLBuffer) {
var level = 0
for (minBuffer, maxBuffer) in zip(minBuffers, maxBuffers) {
if CGFloat(minBuffer.length / MemoryLayout<Float>.size) < width {
return (minBuffer, maxBuffer)
}
level += 1
}
**return (minBuffers.last!, maxBuffers.last!)**
}
I tried to reproduce this in debug mode, but I does not happen there - it happens only with the app compiled for run.
What I see is that in debug the drawing is much slower. So what I suspect is, that as I'm using SwiftUI redraws happen with empty buffers, which cause this.
BTW: thanks for this wonderful implementation of a waveform drawer!
Crash Logs, Screenshots or Other Attachments (if applicable)
No response