Skip to content

Commit

Permalink
Fix out of bounds memory access below, apparently
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Oct 2, 2023
1 parent a568e78 commit 30087b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 30087b2

Please sign in to comment.