summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-01-28 08:01:35 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-01-28 08:01:35 (GMT)
commit7ee90e287a0a8d613e7b76474f9500bb2ac1eed8 (patch)
tree9b38a6c2d32327a6d86d5907724ce5084be60e34 /generic
parentdafd0980f12d3583ecd80f68fe51edcee80c8d6f (diff)
downloadtk-7ee90e287a0a8d613e7b76474f9500bb2ac1eed8.zip
tk-7ee90e287a0a8d613e7b76474f9500bb2ac1eed8.tar.gz
tk-7ee90e287a0a8d613e7b76474f9500bb2ac1eed8.tar.bz2
Fix for [237971ce]: [$canvas insert] changed behaviour. Also added testcase from Emiliano Gavilan.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvLine.c2
-rw-r--r--generic/tkCanvPoly.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c
index e7e8904..07dbb70 100644
--- a/generic/tkCanvLine.c
+++ b/generic/tkCanvLine.c
@@ -1748,7 +1748,7 @@ GetLineIndex(
const char *string;
(void)canvas;
- if (TCL_OK == TkGetIntForIndex(obj, 2*linePtr->numPoints - 1, 0, &idx)) {
+ if (TCL_OK == TkGetIntForIndex(obj, 2*linePtr->numPoints - 1, 1, &idx)) {
if (idx == TCL_INDEX_NONE) {
idx = 0;
} else if (idx > (2*(TkSizeT)linePtr->numPoints)) {
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index 1620914..90b2896 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -1683,6 +1683,8 @@ GetPolygonIndex(
if (TCL_OK == TkGetIntForIndex(obj, (INT_MAX - 1) - ((INT_MAX) % count), 1, &idx)) {
if (idx == TCL_INDEX_NONE) {
idx = 0;
+ } else if (idx >= INT_MAX - ((INT_MAX) % count)) {
+ idx = count;
} else {
idx = (idx & (TkSizeT)-2) % count;
}