From 5e0ccba86a103d0351cd52b61267892911734d38 Mon Sep 17 00:00:00 2001 From: Chris Reddington <791642+chrisreddington@users.noreply.github.com> Date: Mon, 25 Nov 2024 07:45:24 +0000 Subject: [PATCH] Fix validation for triangle count in WriteSTLBinary function --- stl/stl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/stl.go b/stl/stl.go index 16b780a..df70aa7 100644 --- a/stl/stl.go +++ b/stl/stl.go @@ -141,7 +141,7 @@ func WriteSTLBinary(filename string, triangles []types.Triangle) error { } triangleCount := len(triangles) - if triangleCount < 0 || triangleCount > math.MaxUint32 { + if triangleCount < 0 { return errors.New(errors.ValidationError, "invalid number of triangles for STL format", nil) } if err := writeTriangleCount(writer, uint32(triangleCount)); err != nil {