diff --git a/internal/graphics/vertices.go b/internal/graphics/vertices.go index a6276520b..5ef8af029 100644 --- a/internal/graphics/vertices.go +++ b/internal/graphics/vertices.go @@ -50,6 +50,9 @@ func (v *verticesBackend) slice(n int) []float32 { } func isPowerOf2(x int) bool { + if x <= 0 { + return false + } return (x & (x - 1)) == 0 }