diff options
author | Ton Roosendaal <ton@blender.org> | 2009-04-21 17:30:58 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-04-21 17:30:58 +0400 |
commit | ca78b6ee8b7b3eacf2c0cb17fb2570f94dac91b8 (patch) | |
tree | 481f455def7fa4e186a994fa3e75b79dc63ce7c4 /source/blender/imbuf | |
parent | 8b69260f00c32a1ef53c4600684f3271667d800b (diff) |
Bugfix #18519
MultiLayer save (F3) crashes when no rendering/layers exist, happens for
opengl preview render. It now survives, saving empty file and prints error.
Better solution for later: render profiles!
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 3e618a483e3..9e077cbc809 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -570,13 +570,17 @@ void IMB_exr_write_channels(void *handle) FrameBuffer frameBuffer; ExrChannel *echan; - for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) - frameBuffer.insert (echan->name, Slice (FLOAT, (char *)echan->rect, - echan->xstride*sizeof(float), echan->ystride*sizeof(float))); - - data->ofile->setFrameBuffer (frameBuffer); - data->ofile->writePixels (data->height); - + if(data->channels.first) { + for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) + frameBuffer.insert (echan->name, Slice (FLOAT, (char *)echan->rect, + echan->xstride*sizeof(float), echan->ystride*sizeof(float))); + + data->ofile->setFrameBuffer (frameBuffer); + data->ofile->writePixels (data->height); + } + else { + printf("Error: attempt to save MultiLayer without layers.\n"); + } } void IMB_exr_read_channels(void *handle) |