Commit f49e4b42 authored by Ell's avatar Ell

Bug 794634 - CRITICAL when adding layers with Dissolve mode

Fix a CRITICAL when calling gimp_layer_mode_get_format() with an
AUTO composite space and a NULL preferred format, which is valid:
it means the layer mode is composite-space agnostic (as DISSOLVE
is), and that there's no preferred format.

A NULL preferred format can occur during
gimp_operation_layer_mode_prepare() if the layer's mode node is not
yet attached anything through its "input" or "aux" pads, which is
the case during the call to gimp_layer_update_mode_node() while
constructing the layer's node in gimp_layer_get_node().
parent a9c3b4c5
......@@ -1416,7 +1416,7 @@ gimp_layer_mode_get_format (GimpLayerMode mode,
/* compositing is color-space agnostic. return a format that has a fast
* conversion path to/from the preferred format.
if (gimp_babl_format_get_linear (preferred_format))
if (! preferred_format || gimp_babl_format_get_linear (preferred_format))
return babl_format ("RGBA float");
return babl_format ("R'G'B'A float");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment