Skip to content

Commit

Permalink
add_history_item: alloc and copy blendop_params even for modules don'…
Browse files Browse the repository at this point in the history
…t supporting blending.

I'm too lazy to track all the places where `if(module->flags() & IOP_FLAGS_SUPPORTS_BLENDING)` should be added in the app before messing with blendop.
  • Loading branch information
aurelienpierre committed Dec 15, 2023
1 parent 0a2bf45 commit 53c609c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/develop/develop.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,7 @@ static void _dev_add_history_item_ext(dt_develop_t *dev, dt_iop_module_t *module
hist->iop_order = module->iop_order;
hist->multi_priority = module->multi_priority;

if(module->flags() & IOP_FLAGS_SUPPORTS_BLENDING)
hist->blend_params = malloc(sizeof(dt_develop_blend_params_t));
hist->blend_params = malloc(sizeof(dt_develop_blend_params_t));

dev->history = g_list_append(dev->history, hist);

Expand All @@ -748,8 +747,9 @@ static void _dev_add_history_item_ext(dt_develop_t *dev, dt_iop_module_t *module
g_strlcpy(hist->multi_name, module->multi_name, sizeof(hist->multi_name));
memcpy(hist->params, module->params, module->params_size);

if(module->flags() & IOP_FLAGS_SUPPORTS_BLENDING)
memcpy(hist->blend_params, module->blend_params, sizeof(dt_develop_blend_params_t));
// We copy blending params even if the module doesn't support blending.
// It's stupid but other parts of the soft rely on that.
memcpy(hist->blend_params, module->blend_params, sizeof(dt_develop_blend_params_t));

if(include_masks)
{
Expand Down

0 comments on commit 53c609c

Please sign in to comment.