gimp_drawable_get_pixel(): crashes in babl when called on indexed drawable
Environment/Versions
- GIMP version: latest 2.99.19
- Package: self-built
- Operating System: Linux
Description of the bug
In a test script that calls gimp-drawable-get-pixel on indexed drawable
Stacktrace is:
(script-fu:392): scriptfu-DEBUG: 13:13:53.414: calling gimp-drawable-get-pixel
../babl/babl-internal.h:223 babl_fatal()
babl_format("\gimp-indexed-format-3-0x7fe783f60d20"): not found
30 ../sysdeps/unix/sysv/linux/wait4.c: No such file or directory.
#4 0x00007f44e5af20c4 in babl_die () at ../babl/babl-internal.c:76
#5 0x00007f44e5ae99b1 in babl_fatal (format=0x7f44e5b37bb0 "%s(\"%s\"): not found") at ../babl/babl-internal.h:225
#6 0x00007f44e5aeb82d in babl_format (name=0x55c0085d6490 "\\gimp-indexed-format-3-0x7fe783f60d20") at ../babl/babl-format.c:728
#7 0x00007f44e5aeb9d5 in babl_format_with_space (encoding=0x55c0085d6490 "\\gimp-indexed-format-3-0x7fe783f60d20", space=0x7f44e5bcbd20 <space_db>) at ../babl/babl-format.c:768
#8 0x00007f44e6f483b2 in gimp_gp_param_to_value (type=<optimized out>, pspec=<optimized out>, value=<optimized out>, gimp=<optimized out>, param=<optimized out>) at ../gimp/libgimp/gimpgpparams-body.c:749
#9 _gimp_gp_params_to_value_array (gimp=gimp@entry=0x0, pspecs=pspecs@entry=0x0, n_pspecs=n_pspecs@entry=0, params=0x55c008b4bd70, n_params=2, return_values=return_values@entry=1) at ../gimp/libgimp/gimpgpparams-body.c:995
#10 0x00007f44e6f21797 in _gimp_pdb_run_procedure_array (pdb=0x55c00869a190, procedure_name=<optimized out>, arguments=0x55c008a8bc70) at ../gimp/libgimp/gimppdb.c:469
#11 0x00007f44e6f2763a in _gimp_procedure_run_array (procedure=procedure@entry=0x55c008a95150, args=args@entry=0x55c008a8bc70) at ../gimp/libgimp/gimpprocedure.c:2059
#12 0x00007f44e6f2730d in gimp_procedure_run_config (procedure=procedure@entry=0x55c008a95150, config=config@entry=0x55c008b4bb80) at ../gimp/libgimp/gimpprocedure.c:1973
#13 0x00007f44e6faea91 in script_fu_marshal_procedure_call (sc=0x7f44e6fd1268 <sc>, a=<optimized out>, permissive=<optimized out>, deprecated=<optimized out>) at ../gimp/plug-ins/script-fu/libscriptfu/scheme-wrapper.c:1422
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- File>Open wilber.png
- Image>Mode>Indexed and choose Convert
- Open SF Console
- Enter (gimp-drawable-get-pixel 2 1 1) ; drawable is 2, coords are 1,1
(A test script is at plug-ins/script-fu/test/tests/PDB/pixel.scm with the test commented out since it crashes.) …
Expected result: not crash
Actual result: crashes the SF Console, as above
Additional information
gimp-drawable-get-pixel is in v2. In v3 it went away for awhile and is now back with a different signature, returning GeglColor. I was writing exhaustive test scripts for it. Currently ScriptFu should return a list (r g b). ScriptFu probably needs more work to return something meaningful. Anyway, it shouldn't crash.
See #10978