plug-ins: gif export should not carry on when sanity_check() fails.
This specific crash was only occuring when GIMP_INTERACTIVE_EXPORT=1 and canceling the first dialog. So that should not happen too often, but well, now it's fixed…
This commit is contained in:
@ -287,39 +287,39 @@ run (const gchar *name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create an exportable image based on the export options */
|
|
||||||
switch (run_mode)
|
|
||||||
{
|
|
||||||
case GIMP_RUN_INTERACTIVE:
|
|
||||||
case GIMP_RUN_WITH_LAST_VALS:
|
|
||||||
{
|
|
||||||
GimpExportCapabilities capabilities =
|
|
||||||
GIMP_EXPORT_CAN_HANDLE_INDEXED |
|
|
||||||
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
|
||||||
GIMP_EXPORT_CAN_HANDLE_ALPHA;
|
|
||||||
|
|
||||||
if (gsvals.as_animation)
|
|
||||||
capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS;
|
|
||||||
|
|
||||||
export = gimp_export_image (&image_ID, &drawable_ID, "GIF",
|
|
||||||
capabilities);
|
|
||||||
|
|
||||||
if (export == GIMP_EXPORT_CANCEL)
|
|
||||||
{
|
|
||||||
values[0].data.d_status = GIMP_PDB_CANCEL;
|
|
||||||
if (sanitized_image_ID)
|
|
||||||
gimp_image_delete (sanitized_image_ID);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Write the image to file */
|
|
||||||
if (status == GIMP_PDB_SUCCESS)
|
if (status == GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
|
/* Create an exportable image based on the export options */
|
||||||
|
switch (run_mode)
|
||||||
|
{
|
||||||
|
case GIMP_RUN_INTERACTIVE:
|
||||||
|
case GIMP_RUN_WITH_LAST_VALS:
|
||||||
|
{
|
||||||
|
GimpExportCapabilities capabilities =
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_INDEXED |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_ALPHA;
|
||||||
|
|
||||||
|
if (gsvals.as_animation)
|
||||||
|
capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS;
|
||||||
|
|
||||||
|
export = gimp_export_image (&image_ID, &drawable_ID, "GIF",
|
||||||
|
capabilities);
|
||||||
|
|
||||||
|
if (export == GIMP_EXPORT_CANCEL)
|
||||||
|
{
|
||||||
|
values[0].data.d_status = GIMP_PDB_CANCEL;
|
||||||
|
if (sanitized_image_ID)
|
||||||
|
gimp_image_delete (sanitized_image_ID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Write the image to file */
|
||||||
if (save_image (param[3].data.d_string,
|
if (save_image (param[3].data.d_string,
|
||||||
image_ID, drawable_ID, orig_image_ID,
|
image_ID, drawable_ID, orig_image_ID,
|
||||||
&error))
|
&error))
|
||||||
|
Reference in New Issue
Block a user