From b962bdbddd4704558ff6636f677f6f1df96c9995 Mon Sep 17 00:00:00 2001 From: Jacob Boerema Date: Wed, 5 Nov 2025 09:28:45 -0500 Subject: [PATCH] plug-ins: crash on exporting dds with invalid number of mipmaps Closes #15226 When you previously exported a dds with the pre-existing mipmaps, that will be the option selected in the export dialog the next time. If, however, that next time there were an incorrect number of mipmaps available, the option was grayed out, but selected. Exporting then caused a crash due to less mipmap layers being available than expected. When writing the dds settings we need to update that setting in our config object, so that's what we add here. Also remove updating the local variable since that will not be used anymore in this function. --- plug-ins/file-dds/ddswrite.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plug-ins/file-dds/ddswrite.c b/plug-ins/file-dds/ddswrite.c index 33a228f6d3..95b221b5ea 100644 --- a/plug-ins/file-dds/ddswrite.c +++ b/plug-ins/file-dds/ddswrite.c @@ -519,7 +519,11 @@ write_dds (GFile *file, { if (! is_mipmap_chain_valid && mipmaps == DDS_MIPMAP_EXISTING) - mipmaps = DDS_MIPMAP_NONE; + { + g_object_set (config, + "mipmaps", "none", + NULL); + } if (! save_dialog (image, drawable, procedure, config)) return GIMP_PDB_CANCEL;