Not enough capacity for all Magic tools when ungrouped

When "ungroupmagictools" is used, Tux Paint ran out of slots
for magic tools.

Closes https://sourceforge.net/p/tuxpaint/bugs/299/
h/t Billy A.
This commit is contained in:
Bill Kendrick 2025-06-03 22:15:25 -07:00
parent 1f443233d4
commit 6c5258fc7f
4 changed files with 16 additions and 3 deletions

View file

@ -4,14 +4,14 @@
# Various contributors (see AUTHORS.txt)
# https://tuxpaint.org/
# June 14, 2002 - May 26, 2025
# June 14, 2002 - June 3, 2025
# The version number, for release:
# (append "-rc#", e.g. "-rc1", when making release candidates
# for beta testing)
VER_VERSION:=0.9.35
VER_VERSION:=0.9.36
# We are always SDL2 now, so don't need "-sdl2"
VER_FLAVOR:=""

View file

@ -6,6 +6,14 @@ Copyright (c) 2002-2025
Various contributors (see below, and AUTHORS.txt)
https://tuxpaint.org/
2025.June.3 (0.9.36)
* Bug Fixes:
----------
+ When Magic tools are not grouped ("ungroupmagictools"),
the array to hold tools did not have enough capacity.
Closes https://sourceforge.net/p/tuxpaint/bugs/299/
h/t Billy A.
2025.May.26 (0.9.35)
* New Magic Tools:
----------------

View file

@ -47,6 +47,10 @@
</screenshot>
</screenshots>
<releases>
<release version="0.9.36" date="2025-06-03">
<description>
<p>Bug fixes</p>
</description>
<release version="0.9.35" date="2025-05-26">
<description>
<p>New Magic tools: "Hearts", "Sparkles", and "Stars".</p>

View file

@ -1599,8 +1599,9 @@ typedef struct magic_s
} magic_t;
/* FIXME: Really both of these should be dynamically allocated -bjk 2025.06.03 */
#define MAX_MAGIC_GROUPS 16
#define MAX_MAGICS_PER_GROUP 128
#define MAX_MAGICS_PER_GROUP 256
static int num_plugin_files; /* How many shared object files we went through */
static void *magic_handle[MAX_MAGIC_GROUPS * MAX_MAGICS_PER_GROUP]; /* Handle to shared object (to be unloaded later) *//* FIXME: Unload them! */