From 77a1e7ae1dd02f2f0237c954d2f72e6b5810553a Mon Sep 17 00:00:00 2001 From: IllusionMan1212 Date: Mon, 18 May 2026 18:42:41 +0200 Subject: [PATCH] fix: change ArcCircleInstruction radius from Point to Unit; assertion for safety --- tinyvg.odin | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tinyvg.odin b/tinyvg.odin index 263131c..b958480 100644 --- a/tinyvg.odin +++ b/tinyvg.odin @@ -127,7 +127,7 @@ CubicBezierInstruction :: struct { ArcCircleInstruction :: struct { large_arc: bool, sweep: bool, - radius: Point, + radius: Unit, target: Point, } ArcEllipseInstruction :: struct { @@ -581,6 +581,7 @@ read_unit :: proc(r: ^Reader, header: Header) -> (unit: f32, err: Error) { @(private, require_results) read_path :: proc(r: ^Reader, header: Header, segment_count: u32) -> (path: Path, err: Error) { + assert(segment_count <= 1024) // arbitrary limit to avoid unbounded allocations on malformed input segments_instructions: [1024]u32 segments := make([]Segment, segment_count)