Skip to content

Commit

Permalink
Don't be tricky with move()
Browse files Browse the repository at this point in the history
The old code was trying to be clever, and suppress multiple move() calls (since hey, what can that possibly do) ... but
1. other systems (e.g. Skia) like multiple moves() -- it means something to some of their clients
2. this code has a bug!
3. why am I trying to be tricky?

Fix:
- simplify the code
- remove the bug

the bug?
- n is the number of **verbs**, not points
- if there are more verbs than points, then we access out-of-bounds memory in m_points !!!
- its easy to have more verbs than points : move() + close() + move() == 3 verbs and 2 points

could we fix the bug?
- yes, we would use m_points.back() = a instead
- but why bother, just simplify the code

Diffs=
1a605c434 Don't be tricky with move()
  • Loading branch information
mikerreed committed Jul 15, 2022
1 parent 14d9c31 commit 54512df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2cbfd265dd144e6035dce8acdd30116ccd3273a5
1a605c434dc7862d6402c5b2c58dcffb1f0aacf5
2 changes: 1 addition & 1 deletion submodules/rive-cpp

0 comments on commit 54512df

Please sign in to comment.