From f699b34689a2819cb674708530142448385fd886 Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Thu, 11 Sep 2025 12:18:35 +0200 Subject: [PATCH] Fix #146057: Crash when using Convolve node with GPU The Convolve node crashes Blender if used with GPU device and its output is used multiple times. This is due to a use after free error, because the convolve node ignored the reference count of the output. To fix this, we retain the reference count of the output by stealing the data of the GPU-side buffer, instead of overwriting the output with it. Pull Request: https://projects.blender.org/blender/blender/pulls/146074 --- source/blender/compositor/algorithms/intern/convolve.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/compositor/algorithms/intern/convolve.cc b/source/blender/compositor/algorithms/intern/convolve.cc index 81ba1ae5955..b4e87ae3733 100644 --- a/source/blender/compositor/algorithms/intern/convolve.cc +++ b/source/blender/compositor/algorithms/intern/convolve.cc @@ -252,7 +252,8 @@ void convolve(Context &context, }); if (context.use_gpu()) { - output = output_cpu.upload_to_gpu(true); + Result output_gpu = output_cpu.upload_to_gpu(true); + output.steal_data(output_gpu); output_cpu.release(); } else {