From 30087b2042be860c7d59c5ba6e8db2654ce4cea7 Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Sun, 1 Oct 2023 22:30:49 -0700 Subject: [PATCH] Fix out of bounds memory access below, apparently --- serial.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/serial.cpp b/serial.cpp index f3e31ab6e..db8fc21b9 100644 --- a/serial.cpp +++ b/serial.cpp @@ -499,14 +499,13 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) { } } + scaled_geometry = remove_noop(scaled_geometry, sf.t, 0); if (scaled_geometry.size() == 0) { // Feature was clipped away return 1; } if (prevent[P_SIMPLIFY_SHARED_NODES]) { - scaled_geometry = remove_noop(scaled_geometry, sf.t, 0); - if (sf.t == VT_POLYGON || sf.t == VT_LINE) { for (size_t i = 0; i < scaled_geometry.size(); i++) { if (scaled_geometry[i].op == VT_MOVETO) {