fix [#32490] Compsitor crashes on missing OpenEXR multilayer files

This commit is contained in:
2012-09-04 19:42:09 +00:00
parent 306e2b4878
commit 1d4316f35f
5 changed files with 35 additions and 10 deletions

View File

@@ -72,12 +72,16 @@ void ImageNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
/* force a load, we assume iuser index will be set OK anyway */
if (image && image->type == IMA_TYPE_MULTILAYER) {
bool is_multilayer_ok = false;
BKE_image_get_ibuf(image, imageuser);
if (image->rr) {
RenderLayer *rl = (RenderLayer *)BLI_findlink(&image->rr->layers, imageuser->layer);
if (rl) {
OutputSocket *socket;
int index;
is_multilayer_ok = true;
for (index = 0; index < numberOfOutputs; index++) {
socket = this->getOutputSocket(index);
if (socket->isConnected() || index == 0) {
@@ -114,6 +118,11 @@ void ImageNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
}
}
}
/* without this, multilayer that fail to load will crash blender [#32490] */
if (is_multilayer_ok == false) {
convertToOperations_invalid(graph, context);
}
}
else {
if (numberOfOutputs > 0) {