From 6b72a51b173424324e671fae05e11984c0ed308a Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 24 Nov 2021 10:00:15 -0500 Subject: [PATCH] Fixed a segfault condition if doing "splitpaint" on a zero-area rectangle. Likewise, this also fixes an unexpected result when doing "spliterase" on a zero-area rectangle (which does not cause a segfault, but is not what one would want magic to do). --- VERSION | 2 +- commands/CmdRS.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0f142183..df1e6b6d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.230 +8.3.231 diff --git a/commands/CmdRS.c b/commands/CmdRS.c index 95c7a05e..b9d43b1d 100644 --- a/commands/CmdRS.c +++ b/commands/CmdRS.c @@ -2735,6 +2735,8 @@ CmdSplit(w, cmd) if ((direction = GeoNameToPos(cmd->tx_argv[1], FALSE, TRUE)) < 0) return; + if (GEO_RECTNULL(&editRect)) return; /* Nothing to do */ + if (cmd->tx_argc == 4) { if (!CmdParseLayers(cmd->tx_argv[3], &mask2)) @@ -2824,6 +2826,8 @@ CmdSplitErase(w, cmd) if (!ToolGetEditBox(&editRect)) return; + if (GEO_RECTNULL(&editRect)) return; /* Nothing to do */ + if ((direction = GeoNameToPos(cmd->tx_argv[1], FALSE, TRUE)) < 0) return;