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
This commit is contained in:
Omar Emara
2025-09-11 12:18:35 +02:00
committed by Omar Emara
parent ed547afcd2
commit f699b34689

View File

@@ -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 {