Color Space Invasion: crash in channel_get_color_invoker
With latest master testing a Python script doing (shortened):
my_channel = Gimp.Channel.new_from_component (image, Gimp.ChannelType.ALPHA, "my alpha channel")
image.insert_channel(my_channel, None, 0)
channels = image.list_channels()
count = len(channels)
print(f"Count {count} channels {channels}")
if (count > 0):
color = channels[0].get_color()
This crashes on the last line:
> fatal error: unhandled exception
Stack trace:
-------------------
Error occurred on Monday, February 12, 2024 at 11:49:39.
gimp-2.99.exe caused an Access Violation at location 00007FFAA9FAFA62 in module libbabl-0.1-0.dll Reading from location 0000000000000000.
AddrPC Params
00007FFAA9FAFA62 0000000000000000 BA2C4B90AF684C26 0000000000000000 libbabl-0.1-0.dll!babl_format_has_alpha+0x2 [D:/msys64/home/Jacob/build/babl/../../babl/babl/babl-format.c @ 565]
563: babl_format_get_n_components (const Babl *format)
564: {
> 565: if (format->class_type == BABL_FORMAT)
566: {
567: return format->format.components;
00007FFAAF253C8A 0000018F69330210 0000018F0034C060 0000018F69330210 libgimpcolor-3.0-0.dll!gimp_color_set_alpha+0x7a [D:/msys64/home/Jacob/build/gimp/../../gimp/libgimpcolor/gimpcolor.c @ 333]
331: gchar *name;
332:
> 333: if (babl_format_has_alpha (format))
334: return format;
335:
00007FF69579A5DF 0000018F0034C060 0000018F634B4DA0 0000018F65EBEC10 gimp-2.99.exe!channel_get_color_invoker+0x3f [D:/msys64/home/Jacob/build/gimp/../../gimp/app/pdb/channel-cmds.c @ 332]
330: {
331: color = gimp_channel_get_color (channel);
> 332: gimp_color_set_alpha (color, 1.0);
333: }
334:
00007FF69580A44D 0000018F66164650 0000018F66164650 0000000000000000 gimp-2.99.exe!gimp_procedure_execute+0x18d [D:/msys64/home/Jacob/build/gimp/../../gimp/app/pdb/gimpprocedure.c @ 515]
513:
514: /* call the procedure */
> 515: return_vals = GIMP_PROCEDURE_GET_CLASS (procedure)->execute (procedure,
516: gimp,
517: context,
00007FF695806F4B 0000018F65EBEC10 0000018F661644F0 0000000000000000 gimp-2.99.exe!gimp_pdb_execute_procedure_by_name_args+0x16b [D:/msys64/home/Jacob/build/gimp/../../gimp/app/pdb/gimppdb.c @ 320]
318: g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure), NULL);
319:
> 320: return_vals = gimp_procedure_execute (procedure,
321: pdb->gimp, context, progress,
322: args, error);
00007FF69581F062 0000000000000000 00007FFA71973CD1 0000008C72FFF958 gimp-2.99.exe!gimp_plug_in_handle_message+0x222
00007FF69580F60B 0000000000000000 00007FFAE09E07C0 0000000000000000 gimp-2.99.exe!gimp_plug_in_recv_message+0x12b
00007FFA7190EB5C 0000018F00000000 0000018F00543FF0 0000008C000001CF libglib-2.0-0.dll!g_clear_list+0x11ac
00007FFA71911983 0000018F00000000 00007FFADF929C9C 0000008C72FFFAD4 libglib-2.0-0.dll!g_get_monotonic_time+0xa73
00007FFA719120AD 00007FF695B95634 00007FF69587E045 0000000000000000 libglib-2.0-0.dll!g_main_context_iteration+0x2d
00007FFA729B8CB3 00007FFA718EB610 0000000000000000 0000018F32D50620 libgio-2.0-0.dll!g_application_run+0x183
00007FF695859CEE 0000018F32441E90 0000018F32463070 0000018F30C90860 gimp-2.99.exe!app_run+0x24e [D:/msys64/home/Jacob/build/gimp/../../gimp/app/app.c @ 317]
315: G_CALLBACK (app_activate_callback),
316: NULL);
> 317: retval = g_application_run (app, 0, NULL);
318:
319: if (! retval)
00007FF695ADBF8E 0000000000000000 0000018F324C7660 00007FF695CD91C8 gimp-2.99.exe!main+0x52e [D:/msys64/home/Jacob/build/gimp/../../gimp/app/main.c @ 786]
784: user_gimprc_file = g_file_new_for_commandline_arg (user_gimprc);
785:
> 786: retval = app_run (argv[0],
787: filenames,
788: system_gimprc_file,
00007FF6956812EE 0000000000000000 0000000000000000 0000000000000000 gimp-2.99.exe!__tmainCRTStartup+0x16e [C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c @ 267]
00007FF695681406 0000000000000000 0000000000000000 0000000000000000 gimp-2.99.exe!mainCRTStartup+0x16 [C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c @ 188]
00007FFADF497344 0000000000000000 0000000000000000 0000000000000000 KERNEL32.DLL!BaseThreadInitThunk+0x14
00007FFAE09E26B1 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!RtlUserThreadStart+0x21