Fix #119560: Wanderer Demo Crash in 4.1 and 4.2

Add a null pointer check around CPU processor, matching the rest of the
processor access.

This solves crash in cases when the OCIO configuration exists but is
invalid: i.e. by removing a lookup table. It could lead to an invalid
render result, but is better than a crash.

The original issue with running Blender from within .zip archive might
still need investigation, as there might be a way to make it work.

Pull Request: https://projects.blender.org/blender/blender/pulls/119693
This commit is contained in:
Sergey Sharybin
2024-03-20 14:38:23 +01:00
committed by Sergey Sharybin
parent 99b845b1fb
commit 03c7191286
@@ -3953,6 +3953,19 @@ bool IMB_colormanagement_processor_is_noop(ColormanageProcessor *cm_processor)
return false;
}
if (!cm_processor->cpu_processor) {
/* The CPU processor might have failed to be created, for example when the requested color
* space does not exist in the configuration, or if there is a missing lookup table, or the
* configuration is invalid due to other reasons.
*
* The actual processing checks for the cpu_processor not being null pointer, and it if is then
* processing does not apply it. However, processing could still apply curve mapping.
*
* Hence a null-pointer here, which happens after the curve mapping check, but before accessing
* cpu_processor. */
return true;
}
return OCIO_cpuProcessorIsNoOp(cm_processor->cpu_processor);
}