Skip to content

Commit

Permalink
Fix validation for triangle count in WriteSTLBinary function
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisreddington authored Nov 25, 2024
1 parent c7ca274 commit 5e0ccba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stl/stl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5e0ccba

Please sign in to comment.