Skip to content

Commit 39a327d

Browse files
committed
[[ Bug 22060 ]] Stop point values with matching hashes from overwriting each other.
False positives in MCCanvasPoint compare function were leading to point values with duplicate hashes being incorrectly identified as unique, causing the most recent value to be replaced with the existing value. This patch fixes the comparison function in order to remove these false positives.
1 parent 9a5b780 commit 39a327d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/lcb/notes/22060.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# [22060] Fix bug in canvas library that can result in Points being initialized with previously used values.

engine/src/module-canvas.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ static bool __MCCanvasPointEqual(MCValueRef p_left, MCValueRef p_right)
843843
if (p_left == p_right)
844844
return true;
845845

846-
return MCMemoryCompare(MCValueGetExtraBytesPtr(p_left), MCValueGetExtraBytesPtr(p_left), sizeof(__MCCanvasPointImpl)) == 0;
846+
return MCMemoryCompare(MCValueGetExtraBytesPtr(p_left), MCValueGetExtraBytesPtr(p_right), sizeof(__MCCanvasPointImpl)) == 0;
847847
}
848848

849849
static hash_t __MCCanvasPointHash(MCValueRef p_value)

0 commit comments

Comments
 (0)